Helena
Members-
Posts
20 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Helena
-
Tried that but not working. How about the?: setmapflag "arena", mf_loadevent; and the if (compare(strcharinfo(3),"arena")) { Maybe those need changing too? Add multiple comparisons in the expression: if (strcharinfo(3) != "arena" || strcharinfo(3) != "prtg_cas01") end;
-
Thank you sir Capuche, I'll try that! That works great, is there a way to make it go per several maps? example: arena and prtg_cas01? I've tried to put "arena" || "prtg_cas01 but isn't working. >.< Thank you so much!
-
Hello, I am using an IP check/kick script to prevent dual clienting on a certain map. My one problem is that i want to whitelist IPs that have been proven to be actually two individual players and not get kicked by dualing. How to do that? - script BG_Check_IP -1,{ OnInit: setmapflag "arena", mf_loadevent; end; // Trigger when a player enters a map with "loadevent" mapflag. OnPCLoadMapEvent: // Only run for map "arena". if (strcharinfo(3) != "arena") end; // Get list of accounts with attached character's IP address. set [email protected], query_sql("SELECT `account_id` FROM `login` WHERE `last_ip` = '"+getcharip()+"'",[email protected]); // Passed check if only the attached player is returned. if ([email protected] < 2) end; // Check all online characters using the IP address if they are on a Battlegrounds map. set [email protected], getcharid(3); for(set [email protected],0; [email protected]<[email protected]; set [email protected],[email protected]+1) { if ([email protected][[email protected]] == [email protected]) continue; if (attachrid([email protected][[email protected]])) { if (compare(strcharinfo(3),"arena")) { set [email protected]$, strcharinfo(0); attachrid([email protected]); message strcharinfo(0),"Character "[email protected]$+" is already present in this map with your IP. Kicking...."; sleep2 2000; atcommand "@kick "+strcharinfo(0); end; } } } // Passed check. end; }
-
Hey Emistry, thank you for the awesome script! I have one problem. The re-do delay and repeatable doesn't work for me for some reason. If I put 24 hours, it still let's me pick the mission over and over after completion, same with the repeatable status, it's always infinite. I have to admit i did make some changes, but I believe nothing to have that result. Another request if it isn't too much to ask, how do i make it so that when i put repeatable 1, the player can only do it once? Basically a "Can Do: 1 Time(s). Here's the script. Thanks in advance. ^^; - script mission_board -1,{ [email protected]_level = getgmlevel(); [email protected]_name$ = strnpcinfo(1); [email protected]_npc_num = atoi( strnpcinfo(2) ); // check npc if it's a valid npc with number 1 ~ 500 if( [email protected]_npc_num || [email protected]_npc_num > 500 ){ message strcharinfo(0),"This NPC isnt working, invalid <'"+strnpcinfo(2)+"'>"; disablenpc strnpcinfo(0); end; } // to assign offset index. [email protected]_npc_num--; query_sql( "SELECT COUNT(`id`) FROM `mission_board` WHERE `npc_id` LIKE '%|"[email protected]_npc_num+"|%' ",[email protected]_count ); query_sql( "SELECT `id`,`mission_id`,`mob_hunt` FROM `player_mission` WHERE `mission_id` IN ( SELECT `id` FROM `mission_board` WHERE `npc_id` LIKE '%|"[email protected]_npc_num+"|%' ) AND `cid` = "+getcharid(0)+" AND `completion` = '0000-00-00 00:00:00' ",[email protected],[email protected]_id,[email protected]_hunt$ ); [email protected]_mission_size = getarraysize( [email protected] ); mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "The Mission Board will instruct you to hunt certain monsters or items. Completing missions will result into rewards such as EXP and Midgard Coins"; next; mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Every player may pick up to ^FF0000"+.max_mission_per_char+" missions^000000 from the Mission Board."; next; switch( select( ( [email protected]_mission_size )?"Submit Mission":"", ( [email protected]_mission_size < .max_mission_per_char )?"Pick Mission":"", ( [email protected]_mission_size )?"Drop Mission":"", ( [email protected]_level < .gm_level || [email protected]_count )?"":"^FF0000[GM] Update Mission^000000", ( [email protected]_level < .gm_level )?"":"^FF0000[GM] Setup Mission^000000", ( [email protected]_level < .gm_level || [email protected]_count )?"":"^FF0000[GM] Delete Mission^000000" ) ){ Case 1: // get mission data from sql query_sql( "SELECT * FROM `mission_board` WHERE `id` = "[email protected]_id[[email protected]]+" LIMIT 1", [email protected]_id, [email protected]$, [email protected]$, [email protected]_list$, [email protected]_qty$, [email protected]_list$, [email protected]_qty$, [email protected]_job_bitmask, [email protected]_branch_bitmask, [email protected]_lv, [email protected]_lv, [email protected], [email protected], [email protected]_list$, [email protected]_qty$, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]$, [email protected]_update$, [email protected]_id$, [email protected]_delay ); // explode all saved strings to array value. [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); if( [email protected]_size ) callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); if( [email protected]_size ) callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); if( [email protected]_size ) callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_npc_size = callsub( OnExplodeArray,[email protected]_id$,[email protected]_npc_array$,1 ); setarray [email protected]_range,[email protected]_lv,[email protected]_lv; // display the information of mission [email protected] = callsub( OnDisplayMissionInfo, [email protected]_id, [email protected]$, [email protected]$, [email protected]_range, [email protected], [email protected][[email protected]], [email protected]_list, [email protected]_qty, [email protected]_list, [email protected]_qty, [email protected]_job_bitmask, [email protected]_branch_bitmask, [email protected], [email protected], [email protected], [email protected], [email protected]_list, [email protected]_qty, [email protected]_npc_array$, [email protected]_update$, [email protected]_delay, 1|2|4|8 ); // check completed how many times. if( [email protected][[email protected]] ){ query_sql( "SELECT COUNT(`id`),TIMESTAMPDIFF( HOUR,`completion`,NOW() ),DATE_ADD( `completion`, INTERVAL "[email protected]_delay+" HOUR) FROM `player_mission` WHERE `mission_id` = "[email protected][[email protected]]+" AND `completion` <> '0000-00-00 00:00:00'",[email protected]_completed,[email protected]_delay,[email protected]$ ); if( [email protected][[email protected]] && ( ( [email protected]_completed >= [email protected][[email protected]] ) || ( [email protected]_delay && [email protected]_delay <= [email protected]_delay ) ) ){ next; mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes " "; if( [email protected]_completed >= [email protected][[email protected]] ){ mes "You can't pick this mission. You have completed this mission "[email protected]_completed+" time(s). You may only do it that many times."; close; } if( [email protected]_delay && [email protected]_delay <= [email protected]_delay ){ mes "You cant pick this mission, the re-do delay hasn't passed yet."; mes "Approximate : ^FF0000"[email protected]$+"^000000"; close; } } } // submit mission or not if( [email protected] ){ message strcharinfo(0),"Failed to submit this mission."; }else{ next; if( select( "Submit Completed Mission","Cancel" ) == 1 ){ for( [email protected] = ( @ms_size - 1 ); [email protected] >= 0; [email protected] ) if( @ms_list$[[email protected]] == ""[email protected]_id ){ mes "^0055FF[ "[email protected]_name$+" ]^000000"; query_sql( "UPDATE `player_mission` SET `completion` = NOW() WHERE `cid` = "+getcharid(0)+" AND `mission_id` = "[email protected]_id ); mes "Mission accomplished."; @ms_size--; // clear requirement. setd( "@ms_"[email protected]_id+"_expire" ),0; deletearray getd( "@ms_"[email protected]_id+"_list" ); deletearray getd( "@ms_"[email protected]_id+"_qty" ); deletearray getd( "@ms_"[email protected]_id+"_hunt" ); if( [email protected]_size ) for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ debugmes getitemname( [email protected]_list[[email protected]] )+" - "[email protected]_qty[[email protected]]; } // delitem [email protected]_list[[email protected]],[email protected]_qty[[email protected]]; mes "Here are your rewards!"; // rewards getexp [email protected],[email protected]; if( [email protected]_size ) for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ) getitem [email protected]_list[[email protected]],[email protected]_qty[[email protected]]; #CASHPOINTS += [email protected]; Zeny += [email protected]; break; } mes " "; } } break; Case 2: // get info from SQL. do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; deletearray [email protected]; query_sql( "SELECT `id`,`title`,`min_lv`,`max_lv` FROM `mission_board` WHERE `npc_id` LIKE '%|"[email protected]_npc_num+"|%' AND `id` NOT IN ( SELECT `mission_id` FROM `player_mission` WHERE `cid` = "+getcharid(0)+" AND `completion` = '0000-00-00 00:00:00' ) LIMIT "+.max_page_size+" OFFSET "[email protected],[email protected],[email protected]$,[email protected]_lv,[email protected]_lv ); [email protected] += .max_page_size; [email protected] = getarraysize( [email protected] ); if( [email protected] ){ mes "There are no other available missions to pick."; close; }else{ mes "Pick a mission~"; mes "Reminder, the EXP reward that may look like very little is still going to be multiplied by 30 times, which is what our Quest EXP rates are set to!"; [email protected]_menu$ = ""; for( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) [email protected]_menu$ = [email protected]_menu$ + "["[email protected]_lv[[email protected]]+"~"[email protected]_lv[[email protected]]+"] "[email protected]$[[email protected]] +":"; } next; [email protected] = select( [email protected]_menu$+ ( ( [email protected] < .max_page_size )?"":"- next page" ) ) - 1; }while( [email protected] == [email protected] ); query_sql( "SELECT * FROM `mission_board` WHERE `id` = "[email protected][[email protected]]+" LIMIT 1", [email protected]_id, [email protected]$, [email protected]$, [email protected]_list$, [email protected]_qty$, [email protected]_list$, [email protected]_qty$, [email protected]_job_bitmask, [email protected]_branch_bitmask, [email protected]_lv, [email protected]_lv, [email protected], [email protected], [email protected]_list$, [email protected]_qty$, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]$, [email protected]_update$, [email protected]_id$, [email protected]_delay ); // explode all saved strings to array value. [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_npc_size = callsub( OnExplodeArray,[email protected]_id$,[email protected]_npc_array$,1 ); setarray [email protected]_range,[email protected]_lv,[email protected]_lv; // display the information of mission [email protected] = callsub( OnDisplayMissionInfo, [email protected]_id, [email protected]$, [email protected]$, [email protected]_range, [email protected], ( [email protected] + gettimetick(2) ), [email protected]_list, [email protected]_qty, [email protected]_list, [email protected]_qty, [email protected]_job_bitmask, [email protected]_branch_bitmask, [email protected], [email protected], [email protected], [email protected], [email protected]_list, [email protected]_qty, [email protected]_npc_array$, [email protected]_update$, [email protected]_delay, 1|8 ); // check completed how many times. if( [email protected][[email protected]] ){ query_sql( "SELECT COUNT(`id`),TIMESTAMPDIFF( HOUR,`completion`,NOW() ),DATE_ADD( `completion`, INTERVAL "[email protected]_delay+" HOUR) FROM `player_mission` WHERE `mission_id` = "[email protected][[email protected]]+" AND `completion` <> '0000-00-00 00:00:00'",[email protected]_completed,[email protected]_delay,[email protected]$ ); if( [email protected][[email protected]] && ( ( [email protected]_completed >= [email protected][[email protected]] ) || ( [email protected]_delay && [email protected]_delay <= [email protected]_delay ) ) ){ next; mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes " "; if( [email protected]_completed >= [email protected][[email protected]] ){ mes "You cant pick this mission, you have mission completion reach the max repeatable attempt of "[email protected]_completed+" times."; close; } if( [email protected]_delay && [email protected]_delay <= [email protected]_delay ){ mes "You cant pick this mission, you have mission redo delay isnt finish yet."; mes "Approximate : ^FF0000"[email protected]$+"^000000"; close; } } } if( [email protected] ){ message strcharinfo(0),"Failed to pick this mission."; }else{ if( select( "Pick Mission","Cancel" ) == 1 ){ query_sql( "INSERT INTO `player_mission` VALUES ( "+gettimetick(2)+","[email protected]_id+","+getcharid(3)+","+getcharid(0)+",'"+escape_sql( strcharinfo(0) )+"','',"+( [email protected] + gettimetick(2) )+",NOW(),'0000-00-00 00:00:00' );" ); message strcharinfo(0),"Picked Mission # "[email protected]_id; @ms_list$[ @ms_size ] = ""[email protected]_id; @ms_size++; copyarray getd( "@ms_"[email protected]_id+"_list[0]" ),[email protected]_list[0],[email protected]_size; copyarray getd( "@ms_"[email protected]_id+"_qty[0]" ),[email protected]_qty[0],[email protected]_size; deletearray getd( "@ms_"[email protected]_id+"_hunt" ); addtimer ( [email protected] * 1000 ),.npc_name$+"::OnTimeCheck"; } } break; Case 3: query_sql( "SELECT `id`,`title`,`min_lv`,`max_lv` FROM `mission_board` WHERE `npc_id` LIKE '%|"[email protected]_npc_num+"|%' AND `id` IN ( SELECT `mission_id` FROM `player_mission` WHERE `cid` = "+getcharid(0)+" AND `completion` = '0000-00-00 00:00:00' )",[email protected],[email protected]$,[email protected]_lv,[email protected]_lv ); [email protected]_size = getarraysize( [email protected] ); for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ) [email protected]_menu$ = [email protected]_menu$ + "["[email protected]_lv[[email protected]]+"~"[email protected]_lv[[email protected]]+"] "[email protected]$[[email protected]] +":"; mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Pick a Mission to remove."; next; [email protected] = select( [email protected]_menu$ ) - 1; mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Please confirm that you want to remove ^0055FFMission # "[email protected][[email protected]]+"^000000."; mes "Title: ^0055FF"[email protected]$[[email protected]]+"^000000"; mes "^777777NOTE: Any progress you've made for this mission will be lost!^000000"; if( select( "Don't drop mission.","Drop mission." ) == 2 ){ message strcharinfo(0),"Dropped Mission # "[email protected][[email protected]]; query_sql( "DELETE FROM `player_mission` WHERE `mission_id` = "[email protected][[email protected]]+" AND `cid` = "+getcharid(0)+" AND `completion` = '0000-00-00 00:00:00'" ); setd( "@ms_"[email protected][[email protected]]+"_expire" ),0; deletearray getd( "@ms_"[email protected][[email protected]]+"_list" ); deletearray getd( "@ms_"[email protected][[email protected]]+"_qty" ); deletearray getd( "@ms_"[email protected][[email protected]]+"_hunt" ); for( [email protected] = 0; [email protected] < @ms_size; [email protected]++ ) if( ""[email protected][[email protected]] == @ms_list$[[email protected]] ){ deletearray @ms_list$[[email protected]],1; @ms_size--; break; } } break; Case 4: // get info from SQL. do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; deletearray [email protected]; query_sql( "SELECT `id`,`title`,`min_lv`,`max_lv` FROM `mission_board` WHERE `npc_id` LIKE '%|"[email protected]_npc_num+"|%' LIMIT "+.max_page_size+" OFFSET "[email protected],[email protected],[email protected]$,[email protected]_lv,[email protected]_lv ); [email protected] += .max_page_size; [email protected] = getarraysize( [email protected] ); if( [email protected] ){ mes "There are no available mission to update."; close; }else{ mes "Pick a mission."; [email protected]_menu$ = ""; for( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) [email protected]_menu$ = [email protected]_menu$ + "["[email protected]_lv[[email protected]]+"~"[email protected]_lv[[email protected]]+"] "[email protected]$[[email protected]] +":"; } next; [email protected] = select( [email protected]_menu$+ ( ( [email protected] < .max_page_size )?"":"- next page" ) ) - 1; }while( [email protected] == [email protected] ); query_sql( "SELECT * FROM `mission_board` WHERE `id` = "[email protected][[email protected]], [email protected]_mission_id, [email protected]$, [email protected]$, [email protected]_list$, [email protected]_qty$, [email protected]_list$, [email protected]_qty$, [email protected]_job_bitmask, [email protected]_branch_bitmask, [email protected]_lv, [email protected]_lv, [email protected], [email protected], [email protected]_list$, [email protected]_qty$, [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]$, [email protected]_update$, [email protected]_id$, [email protected]_delay ); // explode all saved strings to array value. [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_list$,[email protected]_list,0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_qty$,[email protected]_qty,0 ); [email protected]_npc_size = callsub( OnExplodeArray,[email protected]_id$,[email protected]_npc_array$,1 ); setarray [email protected]_range,[email protected]_lv,[email protected]_lv; Case 5: do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; // display the information of mission callsub( OnDisplayMissionInfo, [email protected]_mission_id, [email protected]$, [email protected]$, [email protected]_range, [email protected], ( [email protected] + gettimetick(2) ), [email protected]_list, [email protected]_qty, [email protected]_list, [email protected]_qty, [email protected]_job_bitmask, [email protected]_branch_bitmask, [email protected], [email protected], [email protected], [email protected], [email protected]_list, [email protected]_qty, [email protected]_npc_array$, [email protected]_update$, [email protected]_delay, 0 ); // check if required info complete for setup mission [email protected] = 0; if( [email protected]$ == "" ) [email protected] |= 1; if( [email protected]$ == "" ) [email protected] |= 2; if( [email protected]_size && [email protected]_size ) [email protected] |= 4; if( getarraysize( [email protected]_range ) != 2 || [email protected]_job_bitmask || [email protected]_branch_bitmask ) [email protected] |= 8; if( [email protected]_size && [email protected] && [email protected] && [email protected] && [email protected] ) [email protected] |= 16; if( [email protected]_npc_size ) [email protected] |= 32; [email protected]_option = select( "Edit Title "+(( [email protected] & 1 )?"^FF0000-incomplete-^000000":"" ), "Edit Description "+(( [email protected] & 2 )?"^FF0000-incomplete-^000000":"" ), "Edit Monster List "+(( [email protected] & 4 )?"^FF0000-incomplete-^000000":( ( [email protected]_size )?"^777777-none-^000000":"" )), "Edit Item List "+(( [email protected] & 4 )?"^FF0000-incomplete-^000000":( ( [email protected]_size )?"^777777-none-^000000":"" )), "Edit Class/Level Limitation "+(( [email protected] & 8 )?"^FF0000-incomplete-^000000":"" ), "Edit Time/Repeat/Mission Limitation ", "Edit Reward List "+(( [email protected] & 16 )?"^FF0000-incomplete-^000000":"" ), "Edit NPC Limitation "+(( [email protected] & 32 )?"^FF0000-incomplete-^000000":"" ), ( [email protected] )?"":"^0055FF - Complete Setup Mission^000000" ); next; switch( [email protected]_option ){ Case 1: mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Enter Title"; mes "^777777( Length: 4 ~ 30 )^000000"; while( input( [email protected]$,4,30 ) ); [email protected]_result = replacestr( [email protected]$,":"," " ); break; Case 2: [email protected]$ = ""; do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Enter Description"; mes "^777777( Length: 4 ~ 255 )^000000"; mes " "; mes "^0055FF"[email protected]$+"^000000"; [email protected] = getstrlen( [email protected]$ ); do{ [email protected]_result = input( [email protected]_input$,4,255 ); if( [email protected]_result ) message strcharinfo(0),"Input length must between 4 ~ 255"; }while( [email protected]_result ); [email protected]$ = [email protected]$ + " "+ [email protected]_input$; mes "^0055FF"[email protected]_input$+"^000000"; [email protected] = getstrlen( [email protected]$ ); next; }while( select( ( [email protected] >= 255 )?"":"add more ^777777( left "+( 255 - [email protected] )+" words )^000000","-back" ) == 1 ); [email protected]$ = replacestr( [email protected]$,":"," " ); break; Case 3: if( [email protected]_mission_id ){ dispbottom "Editing monster list might caused unwanted behaviours of scripts. Which may included :"; dispbottom " > Script/Missions isnt working properly."; dispbottom " > Deletion of player mission's progress."; dispbottom " > etc."; dispbottom "Overall it's not suggested to edit monster list that you have set early."; dispbottom "( Recommend for Re-Adding mission, if needed )"; } do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Monsters to kill:"; if( [email protected]_size ){ [email protected]_menu$ = ""; [email protected]_mob_list$ = "|"; deletearray [email protected]_mob$; for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_name$ = getmonsterinfo( [email protected]_list[[email protected]],MOB_NAME ); [email protected]_menu$ = [email protected]_menu$ + [email protected]_qty[[email protected]] +" x "[email protected]_name$ +":"; mes " ^777777 ~ "[email protected]_qty[[email protected]]+" x "[email protected]_name$+"^000000"; [email protected]_mob_list$ = [email protected]_mob_list$ + [email protected]_list[[email protected]] +"|"; } }else{ mes " ^777777 ~ Unavailable ^000000"; } mes " "; [email protected] = select( ( [email protected]_size >= .max_required_monster )?"":"Add Monster",( [email protected]_size )?"Delete Monster":"","- Back" ); switch( [email protected] ){ Case 1: mes "Enter Monster ID"; do{ input [email protected]_id; if( [email protected]_id ) break; [email protected]_name$ = getmonsterinfo( [email protected]_id,MOB_NAME ); }while( [email protected]_name$ == "null" ); if( [email protected]_name$ != "null" && [email protected]_id ){ mes "How many "[email protected]_name$+" need to hunt ?"; input [email protected],0,30000; if( [email protected] ){ if( compare( "|"[email protected]_mob_list$+"|","|"[email protected]_id+"|" ) ){ for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ) if( [email protected]_list[[email protected]] == [email protected]_id ){ [email protected]_qty[[email protected]] += [email protected]; break; } }else{ [email protected]_list[[email protected]_size] = [email protected]_id; [email protected]_qty[[email protected]_size] = [email protected]; [email protected]_size++; } } } break; Case 2: mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Pick a Monster to Remove."; [email protected] = select( [email protected]_menu$+"- Back" ) - 1; if( [email protected] < [email protected]_size ){ deletearray [email protected]_list[[email protected]],1; deletearray [email protected]_qty[[email protected]],1; [email protected]_size--; } default: break; } if( [email protected] < 3 ) next; }while( [email protected] < 3 ); break; Case 4: do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Required Item List: "; if( [email protected]_size ){ [email protected]_menu$ = ""; [email protected]_item_list$ = "|"; deletearray [email protected]_item$; for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_name$ = getitemname( [email protected]_list[[email protected]] ); [email protected]_menu$ = [email protected]_menu$ + [email protected]_qty[[email protected]] +"x "[email protected]_name$ +":"; mes " ^777777 ~ "[email protected]_qty[[email protected]]+" x "[email protected]_name$+"^000000"; [email protected]_item_list$ = [email protected]_item_list$ + [email protected]_list[[email protected]] + "|"; } }else{ mes " ^777777 ~ Unavailable ^000000"; } mes " "; [email protected] = select( ( [email protected]_size >= .max_required_item )?"":"Add Item",( [email protected]_size )?"Delete Item":"","- Back" ); switch( [email protected] ){ Case 1: do{ input [email protected]_id; if( [email protected]_id ) break; [email protected]_name$ = getitemname( [email protected]_id ); }while( [email protected]_name$ == "null" || [email protected]_name$ == "" ); if( [email protected]_id && [email protected]_name$ != "null" && [email protected]_name$ != "" ){ mes "How many "[email protected]_name$+" need to collect ?"; input [email protected],0,30000; if( [email protected] ){ if( compare( "|"[email protected]_item_list$+"|","|"[email protected]_id+"|" ) ){ for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ) if( [email protected]_list[[email protected]] == [email protected]_id ){ [email protected]_qty[[email protected]] += [email protected]; break; } }else{ [email protected]_list[[email protected]_size] = [email protected]_id; [email protected]_qty[[email protected]_size] = [email protected]; [email protected]_size++; } } } break; Case 2: mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Pick an Item to Remove."; [email protected] = select( [email protected]_menu$+" - Back" ) - 1; if( [email protected] < [email protected]_size ){ mes "Removed "[email protected]_qty[[email protected]]+" x "+getitemname( [email protected]_list[[email protected]] ); deletearray [email protected]_list[[email protected]],1; deletearray [email protected]_qty[[email protected]],1; [email protected]_size--; } default: break; } if( [email protected] < 3 ) next; }while( [email protected] < 3 ); break; Case 5: // class limitation if( [email protected]_job_bitmask ){ // enable all job by default. for( [email protected] = 0; [email protected] < .base_job_size; [email protected]++ ){ [email protected]_value = ( 1 << [email protected] ); [email protected]_job_bitmask |= [email protected]_value; } // enable all inherited classes by default. for( [email protected] = 0; [email protected] < .job_branch_size; [email protected]++ ){ [email protected]_value = ( 1 << [email protected] ); [email protected]_branch_bitmask |= [email protected]_value; } } do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Level Range: "+( ( [email protected]_range[1] )? "^777777"[email protected]_range[0]+" ~ "[email protected]_range[1]:"^FF0000-incomplete-" )+"^000000"; mes "Available Job Setting"; if( [email protected]_job_bitmask ){ for( [email protected] = 0; [email protected] < .base_job_size; [email protected]++ ) if( [email protected]_job_bitmask & ( 1 << [email protected] ) ) mes " ^777777 ~ "+jobname( roclass( .base_job[[email protected]] ) )+" ^000000"; }else{ mes " ^FF0000 -incomplete-^000000"; } mes " "; mes "Inherited Branch Setting"; if( [email protected]_branch_bitmask ){ for( [email protected] = 0; [email protected] < .job_branch_size; [email protected]++ ) if( [email protected]_branch_bitmask & ( 1 << [email protected] ) ) mes " ^777777 ~ "+.job_branch_name$[[email protected]]+" ^000000"; }else{ mes " ^FF0000 -incomplete-^000000"; } next; [email protected] = select( "Edit Base Job","Edit Job Branch","Edit Level Range","- Back" ); switch( [email protected] ){ Case 1: dispbottom "[ Base Job Class ] RED = Disable , GREEN = Enable"; do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Available Job List:"; [email protected]_job_menu$ = ""; for( [email protected] = 0; [email protected] < .base_job_size; [email protected]++ ){ [email protected]_name$ = jobname( roclass( .base_job[[email protected]] ) ); if( [email protected]_job_bitmask & ( 1 << [email protected] ) ) mes " ^777777 ~ "[email protected]_name$+" ^000000"; [email protected]_job_menu$ = [email protected]_job_menu$ + (( [email protected]_job_bitmask & ( 1 << [email protected] ) )?"^4EEE94":"^FF0000" ) + [email protected]_name$ +"^000000:"; } next; [email protected] = select( [email protected]_job_menu$+"- Back" ) - 1; if( [email protected] < .base_job_size ){ [email protected]_value = ( 1 << [email protected] ); if( [email protected]_job_bitmask & [email protected]_value ) [email protected]_job_bitmask -= [email protected]_value; else [email protected]_job_bitmask |= [email protected]_value; } }while( [email protected] < .base_job_size ); break; Case 2: dispbottom "[ Inherited Job Branch ] RED = Disable , GREEN = Enable"; do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Inherited Job Branch List:"; [email protected]_branch_menu$ = ""; for( [email protected] = 0; [email protected] < .job_branch_size; [email protected]++ ){ if( [email protected]_branch_bitmask & ( 1 << [email protected] ) ) mes " ^777777 ~ "+.job_branch_name$[[email protected]]+" ^000000"; [email protected]_branch_menu$ = [email protected]_branch_menu$ + (( [email protected]_branch_bitmask & ( 1 << [email protected] ) )?"^4EEE94":"^FF0000" ) + .job_branch_name$[[email protected]] +"^000000:"; } next; [email protected] = select( [email protected]_branch_menu$+"- Back" ) - 1; if( [email protected] < .job_branch_size ){ [email protected]_value = ( 1 << [email protected] ); if( [email protected]_branch_bitmask & [email protected]_value ) [email protected]_branch_bitmask -= [email protected]_value; else [email protected]_branch_bitmask |= [email protected]_value; } }while( [email protected] < .job_branch_size ); break; Case 3: mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Minimum Level"; input [email protected]_range[0],1,.server_max_level ; mes "Maximum Level"; input [email protected]_range[1],[email protected]_range[0],.server_max_level; default: break; } if( [email protected] < 4 ) next; }while( [email protected] < 4 ); break; Case 6: // mission limitation do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Can do: ^777777"+( ( [email protected] )?"Unlimited times":""[email protected] )+" time(s)^000000"; mes "Redo Delay: ^777777"+( ( [email protected]_delay )?"Unavailable":callsub( OnTime2Str,( ( [email protected]_delay * 3600 ) + gettimetick(2) ) ))+"^000000"; mes "Time Limit: ^777777"+( ( [email protected] )?"Unavailable":callsub( OnTime2Str,( [email protected] + gettimetick(2) ) ) )+"^000000"; [email protected] = select( "Edit Repeatable Status","Edit Time Limit","Edit Re-do Delay","Edit Required Mission","- Back" ); switch( [email protected] ){ Case 1: mes "How many time can this mission repeat ??"; mes "^777777( 0 = unlimited )^000000"; input [email protected],0,100; break; Case 2: mes "Time Limit of mission"; mes " 1 = 1 minute"; mes " 60 = 1 hour"; mes "1440 = 1 day"; input [email protected],0,50000; [email protected] *= 60; break; Case 3: mes "Time Delay to re-take the mission"; mes " 1 = 1 hour"; mes " 24 = 1 day"; mes " 720 = 30 day"; input [email protected]_delay,0,50000; break; Case 4: mes "This is not fully implemented yet.. still in beta test"; break; do{ mes "Required Mission:"; if( [email protected]_mission_size ){ for( [email protected] = 0; [email protected] < [email protected]_mission_size; [email protected]++ ){ mes " ^777777 ~ "[email protected]_mission$[[email protected]]+"^000000"; [email protected]_mission_menu$ = [email protected]_mission_menu$ + [email protected]_mission$[[email protected]] +":"; } }else{ mes "^777777 none ^000000"; } next; [email protected]_option = select( ( [email protected]_mission_size < .max_required_mission )?"Add required mission":"", ( [email protected]_mission_size )?"Remove required mission":"", "- Back"); switch( [email protected]_option ){ Case 1: mes "Enter mission ID"; mes "^777777( enter 0 to cancel )^000000"; do{ input [email protected]_id$; if( [email protected]_id$ == "0" ) break; }while( compare( "|"[email protected]_mission_menu$+"|","|"[email protected]_id$+"|" ) ); [email protected]_id$ = replacestr( [email protected]_id$,":","" ); if( [email protected]_id$ != "0" ){ [email protected]_mission$[[email protected]_mission_size] = [email protected]_id$; [email protected]_mission_size++; } break; Case 2: mes "Select a mission to remove."; [email protected] = select( [email protected]_mission_menu$ ) - 1; deletearray [email protected]_mission$[[email protected]],1; default: break; } }while( [email protected]_option < 3 ); default: break; } if( [email protected] < 5 ) next; }while( [email protected] < 5 ); break; Case 7: // reward list do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Zeny: ^777777"+( ( [email protected] )? [email protected]:"None" )+"^000000"; mes "Reward Item List: "; if( [email protected]_size ){ [email protected]_menu$ = ""; deletearray [email protected]_reward$; for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_name$ = getitemname( [email protected]_list[[email protected]] ); [email protected]_menu$ = [email protected]_menu$ + [email protected]_qty[[email protected]] +"x "[email protected]_name$ +":"; [email protected]_reward$[[email protected]] = [email protected]_name$; mes " ^777777 ~ "[email protected]_qty[[email protected]]+" x "[email protected]_name$+"^000000"; } [email protected]_reward_list$ = implode( [email protected]_reward$,"|" ); }else{ mes " ^777777 ~ none ^000000"; } mes "Base EXP: ^777777"+( ( [email protected] )? [email protected]:"None" )+"^000000"; mes "Job EXP: ^777777"+( ( [email protected] )? [email protected]:"None" )+"^000000"; mes " "; next; [email protected] = select( ( [email protected]_size >= .max_required_item )?"":"Add Item Reward", ( [email protected]_size )?"Delete Item Reward":"", "Edit Cash Reward", "Edit Zeny Reward", "Edit Base EXP Reward", "Edit Job EXP Reward", "- Back" ); mes "^0055FF[ "[email protected]_name$+" ]^000000"; switch( [email protected] ){ Case 1: mes "Enter Reward Item ID"; do{ input [email protected]_id; if( [email protected]_id ) break; [email protected]_name$ = getitemname( [email protected]_id ); }while( [email protected]_name$ == "null" || [email protected]_name$ == "" ); if( [email protected]_id && [email protected]_name$ != "null" && [email protected]_name$ != "" ){ mes "How many "[email protected]_name$+" will be rewarded ?"; input [email protected],0,30000; if( [email protected] ){ if( compare( "|"[email protected]_reward_list$+"|","|"[email protected]_name$+"|" ) ){ for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ) if( [email protected]_list[[email protected]] == [email protected]_id ){ [email protected]_qty[[email protected]] += [email protected]; break; } }else{ [email protected]_list[[email protected]_size] = [email protected]_id; [email protected]_qty[[email protected]_size] = [email protected]; [email protected]_size++; } } } break; Case 2: mes "Pick an Reward to Remove."; [email protected] = select( [email protected]_menu$ ) - 1; mes "Removed "[email protected]_qty[[email protected]]+"x "+getitemname( [email protected]_list[[email protected]] ); deletearray [email protected]_list[[email protected]],1; deletearray [email protected]_qty[[email protected]],1; [email protected]_size--; break; Case 3: mes "How many Cash will be given ?"; mes "^777777( value: 0 ~ "+.max_integer_value+" )^000000"; input [email protected],0,.max_integer_value; break; Case 4: mes "How many Zeny will be given ?"; mes "^777777( value: 0 ~ "+.max_integer_value+" )^000000"; input [email protected],0,.max_integer_value; break; Case 5: mes "How many Base EXP reward ?"; mes "^777777( value: 0 ~ "+.max_integer_value+" )^000000"; input [email protected],0,.max_integer_value; break; Case 6: mes "How many Job EXP reward ?"; mes "^777777( value: 0 ~ "+.max_integer_value+" )^000000"; input [email protected],0,.max_integer_value; default: break; } next; }while( [email protected] < 7 ); break; Case 8: // npc limitation mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "By default, the mission will be available from each mission board npc ^FF0000unless you have specified which NPC may offer this mission.^000000"; mes " "; mes "Just pick all the NPC that may offer this mission if you wish."; next; if( !getarraysize( [email protected]_npc_array$ ) ) for( [email protected] = 0; [email protected] < .mission_npc_count; [email protected]++ ){ [email protected]_npc_array$[[email protected]] = ""[email protected]; [email protected]_npc_size++; } dispbottom "[ NPC Limitation ] RED = Disable , GREEN = Enable"; do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Mission offered by: "; [email protected]_npc_menu$ = ""; if( [email protected]_npc_size >= 2 ){ [email protected]_npc$ = "|"+implode( [email protected]_npc_array$,"|" )+"|"; }else{ [email protected]_npc$ = "|"[email protected]_npc_array$+"|"; } for( [email protected] = 0; [email protected] < .mission_npc_count; [email protected]++ ){ getmapxy( [email protected]$,[email protected],[email protected],1,.npc_unique_list$[[email protected]] ); [email protected]_npc_name$ = ( ( compare( "|"[email protected]_npc$+"|","|"[email protected]+"|" ) )?"^44EE00":"^FF0000" ); [email protected]_npc_name$ = [email protected]_npc_name$ + .npc_name_list$[[email protected]]; mes "^777777("[email protected]$+") "[email protected]_npc_name$; [email protected]_npc_menu$ = [email protected]_npc_menu$ + [email protected]_npc_name$ +":"; } next; [email protected] = select( [email protected]_npc_menu$+"^000000- Back" ) - 1; if( [email protected] < .mission_npc_count ){ if( compare( "|"[email protected]_npc$+"|","|"[email protected]+"|" ) ) [email protected]_npc_array$[[email protected]] = ""; else [email protected]_npc_array$[[email protected]] = ""[email protected]; [email protected]_npc_size = getarraysize( [email protected]_npc_array$ ); } // dispbottom "["+rand(10,99)+"] "+implode( [email protected]_npc_array$,"|" ); }while( [email protected] < .mission_npc_count ); break; default: break; } next; }while( [email protected]_option < 9 ); // finalise all variable if( [email protected]_size ){ [email protected]_mob_list$ = "|"; [email protected]_mob_qty$ = "|"; for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_mob_list$ = [email protected]_mob_list$ + [email protected]_list[[email protected]] +"|"; [email protected]_mob_qty$ = [email protected]_mob_qty$ + [email protected]_qty[[email protected]] +"|"; } } if( [email protected]_size ){ [email protected]_item_list$ = "|"; [email protected]_item_qty$ = "|"; for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_item_list$ = [email protected]_item_list$ + [email protected]_list[[email protected]] +"|"; [email protected]_item_qty$ = [email protected]_item_qty$ + [email protected]_qty[[email protected]] +"|"; } } if( [email protected]_size ){ [email protected]_reward_list$ = "|"; [email protected]_reward_qty$ = "|"; for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_reward_list$ = [email protected]_reward_list$ + [email protected]_list[[email protected]] +"|"; [email protected]_reward_qty$ = [email protected]_reward_qty$ + [email protected]_qty[[email protected]] +"|"; } } if( [email protected]_npc_size ){ [email protected]_npc_list$ = "|"; for( [email protected] = 0; [email protected] < [email protected]_npc_size; [email protected]++ ) [email protected]_npc_list$ = [email protected]_npc_list$ + [email protected]_npc_array$[[email protected]] +"|"; } if( [email protected]_mission_id ){ [email protected]_mission_id = gettimetick(2); message strcharinfo(0),"Mission # "[email protected]_mission_id+" has been added."; }else{ message strcharinfo(0),"Mission # "[email protected]_mission_id+" has been updated."; // attach and inform other online players. callsub( OnRemoveMission,[email protected]_mission_id,"A GM updated Mission # "[email protected]_mission_id ); } // add new mission into SQL query_sql( "REPLACE INTO `mission_board` VALUES ( " + [email protected]_mission_id+", " + "'"+escape_sql( [email protected]$ )+"', " + "'"+escape_sql( [email protected]$ )+"', " + "'"+escape_sql( [email protected]_mob_list$ )+"', " + "'"+escape_sql( [email protected]_mob_qty$ )+"', " + "'"+escape_sql( [email protected]_item_list$ )+"', " + "'"+escape_sql( [email protected]_item_qty$ )+"', " + [email protected]_job_bitmask+", " + [email protected]_branch_bitmask+", " + [email protected]_range[0]+", " + [email protected]_range[1]+", " + [email protected]+", " + [email protected]+", " + "'"+escape_sql( [email protected]_reward_list$ )+"', " + "'"+escape_sql( [email protected]_reward_qty$ )+"', " + [email protected]+", " + [email protected]+", " + [email protected]+", " + [email protected]+", " + getcharid(3)+", " + "'"+escape_sql( strcharinfo(0) )+"', " + "NOW(), " + "'"+escape_sql( [email protected]_npc_list$ )+"', " + [email protected]_delay + " ); " ); break; Case 6: // delete mission do{ mes "^0055FF[ "[email protected]_name$+" ]^000000"; deletearray [email protected]; query_sql( "SELECT `id`,`title`,`min_lv`,`max_lv` FROM `mission_board` WHERE `npc_id` LIKE '%|"[email protected]_npc_num+"|%' LIMIT "+.max_page_size+" OFFSET "[email protected],[email protected],[email protected]$,[email protected]_lv,[email protected]_lv ); [email protected] += .max_page_size; [email protected] = getarraysize( [email protected] ); if( [email protected] ){ mes "There are no available mission to update."; close; }else{ mes "Pick a mission."; for( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) [email protected]_menu$ = [email protected]_menu$ + "["[email protected]_lv[[email protected]]+"~"[email protected]_lv[[email protected]]+"] "[email protected]$[[email protected]] +":"; } next; [email protected] = select( [email protected]_menu$+ ( ( [email protected] < .max_page_size )?"":"- next page" ) ) - 1; }while( [email protected] == [email protected] ); [email protected]_id = [email protected][[email protected]]; mes "^0055FF[ "[email protected]_name$+" ]^000000"; mes "Are you sure to remove this mission ?"; if( select( "Ýes, remove mission.","Delete Mission" ) == 2 ){ query_sql( "DELETE FROM `mission_board` WHERE `id` = "[email protected]_id+" LIMIT 1" ); mes "Removed mission from mission list."; // attach other online players and remove the missions. callsub( OnRemoveMission,[email protected]_id,"A GM removed Mission # "[email protected]_id ); query_sql( "DELETE FROM `player_mission` WHERE `completion` = '0000-00-00 00:00:00' AND `mission_id` = "[email protected]_id ); mes "Removed mission from all players."; } default: break; } close; OnInit: initnpctimer "mission_board"; // initialize settings if( strnpcinfo(0) == "mission_board" ){ // gm level to access panel .gm_level = 90; // max no. of required monster .max_required_monster = 10; // max no. of required item .max_required_item = 10; // max no. of required mission ( un-implement yet ) .max_required_mission = 10; // max no. of available mission .max_mission_available = 50; // max value of integer input .max_integer_value = 2000000000; // max amount of mission per page .max_page_size = 30; // max mission per npc take by character .max_mission_per_char = 3; // predefined values. .npc_name$ = strnpcinfo(0); .server_max_level = getbattleflag( "max_lv" ); setarray .base_job, EAJ_SWORDMAN, EAJ_MAGE, EAJ_ARCHER, EAJ_ACOLYTE, EAJ_MERCHANT, EAJ_THIEF, EAJ_TAEKWON, EAJ_GUNSLINGER, EAJ_NINJA; .base_job_size = getarraysize( .base_job ); setarray .job_branch_name$, "2-1 Classes", "2-2 Classes", "Rebirth Classes", "Baby Classes", "Third Classes"; setarray .job_branch, EAJL_2_1, EAJL_2_2, EAJL_UPPER, EAJL_BABY, EAJL_THIRD; .job_branch_size = getarraysize( .job_branch ); bindatcmd "mission", strnpcinfo(0)+"::OnCommand"; }else{ // delay the process [email protected] = atoi( strnpcinfo(2) ); if( [email protected] && [email protected] <= 500 && .mission_npc_count < 100 ){ sleep( [email protected] + 1 ); .npc_name_list$[ .mission_npc_count ] = strnpcinfo(1); .npc_unique_list$[ .mission_npc_count ] = strnpcinfo(0); debugmes "["+.mission_npc_count+"]"+.npc_name_list$[ .mission_npc_count ]+"|"+.npc_unique_list$[ .mission_npc_count ]; .mission_npc_count++; end; }else if( [email protected] ){ debugmes "[Removed] "+strnpcinfo(0)+", invalid <num:'"+strnpcinfo(2)+"'>"; }else if( .mission_npc_count >= 100 ){ debugmes "[Skipped] "+strnpcinfo(0)+", max: 100 Total NPC."; } disablenpc strnpcinfo(0); } end; // just used to display how many total Mission Board NPC. OnTimer1000: stopnpctimer; debugmes "[ Mission Board ] Total NPC Loaded : "+.mission_npc_count+" ..."; end; OnCommand: if ( strnpcinfo(0) == .npc_name$ ) { if ( @ms_size ) { for ( [email protected] = 0; [email protected] < @ms_size; [email protected]++ ) { [email protected]_size = getarraysize( getd( "@ms_"+ @ms_list$[[email protected]] +"_list" ) ); query_sql "select title, item_list, item_qty from mission_board where id = "+ @ms_list$[[email protected]], [email protected]$, [email protected]_id$, [email protected]_amount$; if ( [email protected]_size ) { for ( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ) // dispbottom "[Mission '"+ [email protected]$ +"' Progress] Hunted "+ getd( "@ms_"+ @ms_list$[[email protected]] +"_hunt["+ [email protected] +"]" ) +"x "+ getmonsterinfo( getd( "@ms_"+ @ms_list$[[email protected]] +"_list["+ [email protected] +"]" ), MOB_NAME ); dispbottom "[Mission '"+ [email protected]$ +"' Progress] Hunted "+ getd( "@ms_"+ @ms_list$[[email protected]] +"_hunt["+ [email protected] +"]" ) +"/"+ getd( "@ms_"+ @ms_list$[[email protected]] +"_qty[" + [email protected] +"]" ) +" x "+ getmonsterinfo( getd( "@ms_"+ @ms_list$[[email protected]] +"_list["+ [email protected] +"]" ), MOB_NAME ); explode [email protected]_id_array$, [email protected]_id$, "|"; explode [email protected]_amount_array$, [email protected]_amount$, "|"; [email protected] = getarraysize( [email protected]_id_array$ ); for ( [email protected] = 1; [email protected] < [email protected]; [email protected]++ ) dispbottom "[Mission '"+ [email protected]$ +"' Progress] Collected "+ countitem( atoi( [email protected]_id_array$[[email protected]] ) ) +"/"+ [email protected]_amount_array$[[email protected]] +" x "+ getitemname( atoi( [email protected]_id_array$[[email protected]] ) ); } } } } end; // OnWhisperGlobal: OnPCLoginEvent: if( strnpcinfo(0) == .npc_name$ ){ [email protected] = gettimetick(2); query_sql( "SELECT `mission_id`,`expire`,`mob_hunt` FROM `player_mission` WHERE `completion` = '0000-00-00 00:00:00' AND `cid` = "+getcharid(0),@ms_list$,[email protected],[email protected]_hunt$ ); @ms_size = getarraysize( @ms_list$ ); if( @ms_size ) for( [email protected] = 0; [email protected] < @ms_size; [email protected]++ ){ if( [email protected] < [email protected][[email protected]] ){ [email protected] = ( [email protected][[email protected]] - [email protected] ); addtimer ( [email protected] * 1000 ),.npc_name$+"::OnTimeCheck"; //dispbottom "[ Mission Progress : "[email protected]_list$[[email protected]]+" , expire in "+callsub( OnTime2Str,( [email protected] + [email protected] ) )+" ]"; query_sql( "SELECT `mob_list`,`mob_qty` FROM `mission_board` WHERE `id` = "[email protected]_list$[[email protected]],[email protected]_list$,[email protected]_qty$ ); setd( "@ms_"[email protected]_list$[[email protected]]+"_expire" ),[email protected][[email protected]]; if( callsub( OnExplodeArray,[email protected]_list$[[email protected]],getd( "@ms_"[email protected]_list$[[email protected]]+"_list" ),0 ) ){ callsub( OnExplodeArray,[email protected]_hunt$[[email protected]],getd( "@ms_"[email protected]_list$[[email protected]]+"_qty" ),0 ); [email protected]_size = callsub( OnExplodeArray,[email protected]_hunt$[[email protected]],getd( "@ms_"[email protected]_list$[[email protected]]+"_hunt" ),0 ); // for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ) // dispbottom " ~ killed "+getd( "@ms_"[email protected]_list$[[email protected]]+"_hunt["[email protected]+"]" )+"/"+getd( "@ms_"[email protected]_list$[[email protected]]+"_qty["[email protected]+"]" )+" x "+getmonsterinfo( getd( "@ms_"[email protected]_list$[[email protected]]+"_list["[email protected]+"]" ),MOB_NAME ); } } } } end; OnPCLogoutEvent: if( strnpcinfo(0) == .npc_name$ ){ if( @ms_size ) for( [email protected] = 0; [email protected] < @ms_size; [email protected]++ ){ debugmes "Saving "[email protected]_list$[[email protected]]; [email protected]_size = getarraysize( getd( "@ms_"[email protected]_list$[[email protected]]+"_list" ) ); if( [email protected]_size ){ copyarray [email protected]_array[0],getd( "@ms_"[email protected]_list$[[email protected]]+"_list[0]" ),[email protected]_size; [email protected]_hunt$ = "|"; for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ) [email protected]_hunt$ = [email protected]_hunt$ + getd( "@ms_"[email protected]_list$[[email protected]]+"_hunt["[email protected]+"]" ) +"|"; query_sql( "UPDATE `player_mission` SET `mob_hunt` = '"+escape_sql( [email protected]_hunt$ )+"' WHERE `mission_id` = "[email protected]_list$[[email protected]]+" AND `completion` = '0000-00-00 00:00:00' AND `cid` = "+getcharid(0) ); } } } end; OnNPCKillEvent: if( strnpcinfo(0) == .npc_name$ ){ if( @ms_size ){ [email protected]$ = strcharinfo(3); // by default mission wont work in PVP,GVG,Instance,Event maps if( compare( [email protected]$,"@" ) || getmapflag( [email protected]$,mf_gvg ) || getmapflag( [email protected]$,mf_pvp )){ //dispbottom "[Mission Board] PvP, GvG, Instance and Event Map , include monsters will not affect Mission Progress."; end; } [email protected] = gettimetick(2); for( [email protected] = ( @ms_size - 1 ); [email protected] >= 0; [email protected] ){ [email protected]_size = getarraysize( getd( "@ms_"[email protected]_list$[[email protected]]+"_list" ) ); if( [email protected]_size ){ copyarray [email protected]_array[0],getd( "@ms_"[email protected]_list$[[email protected]]+"_list[0]" ),[email protected]_size; for( [email protected] = 0; [email protected]_size; [email protected]++ ) if( [email protected]_array[[email protected]] == killedrid ){ [email protected] = getd( "@ms_"[email protected]_list$[[email protected]]+"_hunt["[email protected]+"]" ) + 1; setd( "@ms_"[email protected]_list$[[email protected]]+"_hunt["[email protected]+"]" ),[email protected]; dispbottom "[Mission #"[email protected]_list$[[email protected]]+" Progress] You have killed "[email protected]+"x "+getmonsterinfo( [email protected]_array[[email protected]],MOB_NAME ); break; } deletearray [email protected]_array; } } } } end; OnRemoveMission: [email protected]_id = getarg(0); [email protected]$ = getarg(1); query_sql( "SELECT `aid`,`cid` FROM `player_mission` WHERE `cid` IN ( SELECT `char_id` FROM `char` WHERE `online` = 1 ) AND `mission_id` = "[email protected]_id+" AND `completion` = '0000-00-00 00:00:00' LIMIT 128",[email protected],[email protected] ); [email protected]_size = getarraysize( [email protected] ); [email protected] = 0; [email protected]_aid = getcharid(3); while( [email protected] < [email protected]_size ){ if( isloggedin( [email protected][[email protected]],[email protected][[email protected]] ) ){ attachrid( [email protected][[email protected]] ); for( [email protected] = @ms_size; [email protected] >= 0; [email protected] ) if( @ms_list$[[email protected]] == ""[email protected]_id ){ message strcharinfo(0),[email protected]$; dispbottom "Please visit Mission NPC to gain latest information."; setd( "@ms_"[email protected]_list$[[email protected]]+"_expire" ),0; deletearray getd( "@ms_"[email protected]_list$[[email protected]]+"_list" ); deletearray getd( "@ms_"[email protected]_list$[[email protected]]+"_qty" ); deletearray getd( "@ms_"[email protected]_list$[[email protected]]+"_hunt" ); deletearray @ms_list$[[email protected]],1; @ms_size--; break; } detachrid; [email protected]++; } [email protected]++; } attachrid( [email protected]_aid ); dispbottom "Total "[email protected]+" online players affected."; return; // usage : // [email protected] = callsub( OnTime2Str,<time> ); OnTime2Str: [email protected] = getarg(0); [email protected] = ( [email protected] - gettimetick(2) ); [email protected] = ( [email protected] / 3600 ); [email protected] = ( [email protected] % 3600 / 60 ); [email protected] = ( [email protected] % 60 ); if( [email protected] ) return "none"; else return "^777777"+( ( [email protected] )? [email protected]+" hr ":"" ) + ( ( [email protected] || [email protected] )? [email protected]+" min ":"" ) [email protected]+" sec^000000"; // usage : // [email protected]_array_size = callsub( OnExplodeArray,<old string variable>,<new array variable>,<save '0'> ); OnExplodeArray: [email protected] = getarg(2); explode( getarg(0),getarg(0),"|" ); [email protected] = getarraysize( getarg(0) ); while( [email protected] < [email protected] ){ if( [email protected] ){ [email protected] = atoi( getelementofarray( getarg(0),[email protected] ) ); if( [email protected] ){ set getelementofarray( getarg(1),[email protected]_size ),[email protected]; [email protected]_size++; } }else{ set getelementofarray( getarg(1),[email protected]_size ),getelementofarray( getarg(0),[email protected] ); [email protected]_size++; } [email protected]++; } return [email protected]_size; // display mission information + optional progress checking OnDisplayMissionInfo: [email protected]_id = getarg(0); [email protected]$ = getarg(1); [email protected]$ = getarg(2); [email protected] = getarg(4); [email protected] = getarg(5); [email protected]_size = getarraysize( getarg(6) ); [email protected]_size = getarraysize( getarg(8) ); [email protected]_job_bitmask = getarg(10); [email protected]_branch_bitmask = getarg(11); [email protected] = getarg(12); [email protected] = getarg(13); [email protected] = getarg(14); [email protected] = getarg(15); [email protected]_size = getarraysize( getarg(16) ); [email protected]_npc_size = getarraysize( getarg(18) ); [email protected]_update$ = getarg(19); [email protected]_delay = getarg(20); [email protected]_progress = getarg(21); if( [email protected]_progress & 8 ) [email protected] = eaclass(); // display mission info mes ""+(( [email protected]_id )? "^FF0000Mission ID # "[email protected]_id:" " )+"^000000"; mes "Title: "+( ( [email protected]$ != "" )?"^777777"[email protected]$:"^FF0000-incomplete-" )+"^000000"; mes "Description: "+( ( [email protected]$ != "" )?"^777777"[email protected]$:"^FF0000-incomplete-" )+"^000000"; mes "Level Range: "+( ( getelementofarray( getarg(3),0 ) )? "^777777"+getelementofarray( getarg(3),0 )+" ~ "+getelementofarray( getarg(3),1 ):"^FF0000-incomplete-" )+"^000000"; if( [email protected]_progress & 1 ) if( BaseLevel >= getelementofarray( getarg(3),0 ) && BaseLevel <= getelementofarray( getarg(3),1 ) ) [email protected]_progress = 1; mes "Can do: ^777777"+( ( [email protected] )?"Repeatedly":[email protected]+" time(s)" )+"^000000"; mes "Re-do Delay: ^777777"+( ( [email protected]_delay )?"Unavailable":callsub( OnTime2Str,( ( [email protected]_delay * 3600 ) + gettimetick(2) ) ) )+"^000000"; [email protected]$ = (( [email protected]_size && [email protected]_size )?"^FF0000Incomplete":"^777777Unavailable" ); mes "Monsters to kill: "+( ( [email protected]_size )?"":[email protected]$ )+"^000000"; if( [email protected]_size ) for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_id = getelementofarray( getarg(6),[email protected] ); [email protected] = getelementofarray( getarg(7),[email protected] ); if( [email protected]_progress & 2 ){ [email protected]_count = getd( "@ms_"[email protected]_id+"_hunt["[email protected]+"]" ); if( [email protected]_count >= [email protected] ){ [email protected]_progress++; [email protected]_color$ = "44EE99"; }else{ [email protected]_color$ = "FF0000"; } } mes " ^777777"[email protected]+" x "+getmonsterinfo( [email protected]_id,MOB_NAME )+" "+( ( [email protected]_progress & 2 )?"^"[email protected]_color$+"(killed "[email protected]_count+")":"" )+"^000000"; } mes "Items to collect: "+( ( [email protected]_size )?"":[email protected]$ )+"^000000"; if( [email protected]_size ) for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_id = getelementofarray( getarg(8),[email protected] ); [email protected] = getelementofarray( getarg(9),[email protected] ); [email protected]_type = getiteminfo( [email protected]_id,2 ); if( [email protected]_progress & 4 ){ [email protected]_count = countitem( [email protected]_id ); if( [email protected]_count >= [email protected] ){ [email protected]_progress++; [email protected]_color$ = "44EE99"; }else{ [email protected]_color$ = "FF0000"; } } mes " ^777777"[email protected]+" x "+getitemname( [email protected]_id )+" "+( ( [email protected]_type == 4 || [email protected]_type == 5 )?"["+getitemslots( [email protected]_id )+"]":"" )+" "+( ( [email protected]_progress & 4 )?"^"[email protected]_color$+"(have "[email protected]_count+")":"" )+"^000000"; } mes " "; mes "EXP Rewards: "; mes "^777777 ~ Base EXP: "+( ( [email protected] )? [email protected]:"None" )+"^000000"; mes "^777777 ~ Job EXP: "+( ( [email protected] )? [email protected]:"None" )+"^000000"; mes " "; mes "Item / Zeny Rewards: "+( ( [email protected]_size )?"":"^777777Unavailable" )+"^000000"; mes "^777777 ~ "+( ( [email protected] )? [email protected]+" Zeny":" ~ No Zeny Reward" )+"^000000"; if( [email protected]_size ) for( [email protected] = 0; [email protected] < [email protected]_size; [email protected]++ ){ [email protected]_id = getelementofarray( getarg(16),[email protected] ); [email protected]_type = getiteminfo( [email protected]_id,2 ); mes " ^777777 ~ "+getelementofarray( getarg(17),[email protected] )+" x "+getitemname( [email protected]_id )+" "+( ( [email protected]_type == 4 || [email protected]_type == 5 )?"["+getitemslots( [email protected]_id )+"]":"" )+"^000000"; } mes " "; if( [email protected]_update$ != "0000-00-00 00:00:00" && [email protected]_update$ != "" ){ mes "Last Mission Update:"; mes "^777777"[email protected]_update$+"^000000"; } if( [email protected]_progress ){ if( [email protected]_progress & 1 && [email protected]_progress ){ dispbottom "[Failed] Your level didnt meet the requirements."; [email protected]_result |= 1; } if( [email protected]_progress & 2 && [email protected]_size != [email protected]_progress ){ dispbottom "[Failed] Your Monsters Hunt didnt meet the requirements."; [email protected]_result |= 2; } if( [email protected]_progress & 4 && [email protected]_size != [email protected]_progress ){ dispbottom "[Failed] Your Items collecting didnt meet the requirements."; [email protected]_result |= 4; } } return [email protected]_result; } // the number behind the NPC name must be NUMBER with range of ( 1 ~ 500 ) // the number should stay the same for eternity, if you change it frequently, it might affect your missions for each NPC. // ( to conclude, once you assigned the number, dont change it for the sake of your mission board ... ) harmonia,173,90,1 duplicate(mission_board) Mission Board#1 837 //prontera,105,238,4 duplicate(mission_board) Mission B#2 837 //prontera,105,236,4 duplicate(mission_board) Mission C#3 837 //prontera,105,234,4 duplicate(mission_board) Mission D#4 837 //prontera,108,238,4 duplicate(mission_board) Mission E#5 837 //prontera,108,236,4 duplicate(mission_board) Mission F#6 837 //prontera,108,234,4 duplicate(mission_board) Mission G#7 837 //prontera,108,232,4 duplicate(mission_board) Mission H#8
-
Hello rAthena. Maybe this is not the right place to ask but I still want to give it a try hoping for a web-coder to catch this.... I've installed Feefty's support ticket system for flux and everything went fine, until I wanted to reply to the ticket. The red circle shows where my reply shows up... it's completely of from where it is suppose to be. =l Here is the code. I hope someone can help me out.... I'm willing to pay is needed. <?php if (!defined('FLUX_ROOT')) exit; ?> <h2><?php echo htmlspecialchars(Flux::message('ViewSupportHeading')) ?> <a title='Refresh this page' href='<?= getURL($params->get('id'), $this->url('support', 'view')) ?>'> </a></h2> <?php if (!empty($errorMessage)): ?> <p class="red"><?php echo htmlspecialchars($errorMessage) ?></p> <?php elseif (!empty($successMessage)): ?> <p class="green"><?php echo htmlspecialchars($successMessage) ?></p> <?php endif ?> <?php if (!is_null($ticket_res)): ?> <form action="<?php echo $this->urlWithQs ?>" method="post"> <input type='hidden' name='ticket_id' value='<?= (int) $ticket_res->id ?>' /><br><br><br><br><br><br><br><br> <table> <tr> <?php if (isSubscribed($ticket_res->id, $session->account->account_id, $server)): ?> <td><button title='Unsubscribe from this Ticket' name='take_action' value='unsubscribe' style='background:none;border:none;cursor:pointer'> <img src="<?php echo $this->themePath('img/unsubscribe.png') ?>" onmouseover="this.src='<?php echo $this->themePath('img/unsubscribe.png') ?>'" onmouseout="this.src='<?php echo $this->themePath('img/unsubscribe.png') ?>'"/></a> Unsubscribe </button> </td> <?php else: ?> <td><button title='Subscribe to this Ticket' name='take_action' value='subscribe' style='background:none;border:none;cursor:pointer'> <img src="<?php echo $this->themePath('img/subscribe.png') ?>" onmouseover="this.src='<?php echo $this->themePath('img/subscribe.png') ?>'" onmouseout="this.src='<?php echo $this->themePath('img/subscribe.png') ?>'"/></a> Subscribe </button> </td> <?php endif ?> <?php if ($session->account->$group_col >= Flux::config('TicketCloseGroup') && $ticket_res->status != 0): ?> <td><button title='Close this Support Ticket' name='take_action' value='close' style='background:none;border:none;cursor:pointer'> <img src="<?php echo $this->themePath('img/close.png') ?>" onmouseover="this.src='<?php echo $this->themePath('img/close.png') ?>'" onmouseout="this.src='<?php echo $this->themePath('img/close.png') ?>'"/></a> Close </button> </td> <?php endif ?> <?php if ($session->account->$group_col >= Flux::config('TicketOpenGroup') && $ticket_res->status != 1): ?> <td><button title='Re-Open this Support Ticket' name='take_action' value='open' style='background:none;border:none;cursor:pointer'> <img src="<?php echo $this->themePath('img/open.png') ?>" onmouseover="this.src='<?php echo $this->themePath('img/open.png') ?>'" onmouseout="this.src='<?php echo $this->themePath('img/open.png') ?>'"/></a> Open </button> </td> <?php endif ?> <?php if ($session->account->$group_col >= Flux::config('TicketResolveGroup') && $ticket_res->status != 2): ?> <td><button title='Issue has been resolved' name='take_action' value='resolve' style='background:none;border:none;cursor:pointer'> <img src="<?php echo $this->themePath('img/resolve.png') ?>" onmouseover="this.src='<?php echo $this->themePath('img/resolve.png') ?>'" onmouseout="this.src='<?php echo $this->themePath('img/resolve.png') ?>'"/></a> Resolve </button> </td> <?php endif ?> <?php if ($session->account->$group_col >= Flux::config('TicketDelGroup')): ?> <td><button title='Delete this Support Ticket' name='take_action' value='delete' onclick="if(!confirm('Are you sure about this?')) return false;" style='background:none;border:none;cursor:pointer'> <img src="<?php echo $this->themePath('img/delete.png') ?>" onmouseover="this.src='<?php echo $this->themePath('img/delete.png') ?>'" onmouseout="this.src='<?php echo $this->themePath('img/delete.png') ?>'"/></a> Delete </button> </td> <?php endif ?> <?php if ($session->account->$group_col >= Flux::config('TicketEditGroup')): ?> <td><button type='button' title='Edit' onclick="parent.location='<?= getURL($ticket_res->id, $this->url('support', 'edit')) ?>'" style='background:none;border:none;cursor:pointer'> <img src="<?php echo $this->themePath('img/edit.png') ?>" onmouseover="this.src='<?php echo $this->themePath('img/edit.png') ?>'" onmouseout="this.src='<?php echo $this->themePath('img/edit.png') ?>'"/></a> Edit </button> </td> <?php endif ?> </tr> </table> </form> <hr style='border:none;padding-top:5px;' /> <table class="horizontal-table"> <tr> <tr> <th>Submitted</th> <th>Ticket ID#</th> <th>Priority</th> <th>Status</th> <th>Department</th> <th>Character Affected</th> </tr> <tr> <td style='text-align:center;'><?= date(Flux::config('DateTimeFormat'), strtotime($ticket_res->datetime_submitted)) ?></td> <td style='text-align:center;'><?= (int)$ticket_res->id ?></td> <td style='text-align:center;'><?= getPriority($ticket_res->priority) ?></td> <td style='text-align:center;'><?= getStatus($ticket_res->status) ?></td> <td style='text-align:center;'><?= getDepartment($server, $ticket_res->department)->name ?></td> <?php if ($session->account->$group_col >= Flux::config('TicketShowChar') && $ticket_res->char_id): ?> <td style='text-align:center;'><a title='View Character' href='<?= getURL($ticket_res->char_id, $this->url('character', 'view')) ?>'><?php echo (getCharAffected($ticket_res->char_id, $server) ? getCharAffected($ticket_res->char_id, $server) : "<span style='color:#999'>None</span>") ?></a></td> <?php else: ?> <td style='text-align:center;'><?php echo (getCharAffected($ticket_res->char_id, $server) ? getCharAffected($ticket_res->char_id, $server) : "<span style='color:#999'>None</span>") ?></td> <?php endif ?> </tr> </table> <hr style='border:none;padding-top:5px;' /> <table class='horizontal-table'> <tr> <th> <span style='float:left;font-size:18px;color:#4083c6;max-width:90%'><?= htmlspecialchars($ticket_res->subject) ?></span> <span style='float:right;'> <?php if ($session->account->$group_col >= Flux::config('TicketShowUsername')): ?> <a href='<?= getURL($ticket_res->account_id, $this->url('account', 'view')) ?>'> <?php endif ?> <?= getNickname($ticket_res->account_id, $server) ?> <?php if ($session->account->$group_col >= Flux::config('TicketShowUsername')): ?> </a> <?php endif ?> </span> </th> </tr> <tr> <td><?= $ticket_res->message ?></td> </tr> </table> <h3 style='padding:0;' id='reply_area'>Reply</h3> <?php if ($ticket_res->status != 0 && $ticket_res->status != 2): ?> <form action="<?php echo $this->urlWithQs ?>#reply_area" method="post" class="generic-form"> <input type='hidden' name='account_id' value='<?= (int) $session->account->account_id ?>' /> <input type='hidden' name='ticket_id' value='<?= (int) $ticket_res->id ?>' /> <input type='hidden' name='subscribe' value='<?= (int) $ticket_res->subscribe ?>' /> <input type='hidden' name='subject' value='<?= $ticket_res->subject ?>' /> <input type='hidden' name='priority' value='<?= $ticket_res->priority ?>' /> <input type='hidden' name='email' value='<?= $ticket_res->email ?>' /> <textarea style='width:500px' id='reply' name='reply'></textarea><br /> <input type='submit' value='Submit Reply' /> <?php if ($session->account->$group_col >= AccountLevel::LOWGM): ?> <input type='radio' id='nothing' name='status' value='3' checked='checked' /> <label for='nothing'>Do nothing</label> <input type='radio' id='close' name='status' value='0' /> <label for='close'>Close</label> <input type='radio' id='resolved' name='status' value='2' /> <label for='resolved'>Resolve</label> <?php else: ?> <input type='hidden' name='status' value='3' /> <?php endif ?> </form> <hr style='border:none;padding-top:5px;' /> <?php endif ?> <?php if (count($reply_res) !== 0): ?> <?php echo $paginator->infoText() ?> <form action="<?php echo $this->urlWithQs ?>" method="post"> <?php $i = 0; foreach ($reply_res as $row): ?> <?php if ($i !== 0): ?> <hr style='border:none;padding-top:2px;' /> <?php endif ?> <table class='horizontal-table'> <tr> <th> <span style='display:block;float:left;'> <?php if ($session->account->$group_col >= Flux::config('TicketShowUsername')): ?> <a href='<?= getURL($ticket_res->account_id, $this->url('account', 'view')) ?>'> <?php endif ?> <?php echo (getGroupID($row->account_id, $server) >= AccountLevel::LOWGM ? "<img src='".Flux::config('BaseURI').FLUX_ADDON_DIR.'/support/themes/'.Flux::config('ThemeName').'/img/staff.png'."' alt='Staff' border='' title='Staff' />" : "")." ".getNickname($row->account_id, $server) ?> <?php if ($session->account->$group_col >= Flux::config('TicketShowUsername')): ?> </a> <?php endif ?> </span> <span style='display:block;float:right;'> <?= date(Flux::config('DateTimeFormat'), strtotime($row->datetime_submitted)) ?> </span> </th> </tr> <tr class='deleteTrigger'> <td<?php echo (getGroupID($row->account_id, $server) >= AccountLevel::LOWGM ? " style='background:#fff3d8'" : " style='background:#e4ffe8'") ?>> <span style='width:90%;dispaly:block;float:left'><?= $row->reply ?></span> <?php if ($session->account->$group_col >= AccountLevel::LOWGM): ?> <span style='display:block;float:right;height:25px'><button style='display:none' type='submit' name='delete_reply' value='<?= (int) $row->id ?>' onclick="if(!confirm('Are you sure about this?'))return false;">Delete</button></span> <?php endif ?> </td> </tr> </table> <?php $i++; endforeach ?> </form> <?php echo $paginator->getHTML() ?> <?php endif ?> <script src='<?= Flux::config('BaseURI').FLUX_ADDON_DIR.'/support/themes/'.Flux::config('ThemeName').'/js/nicEdit.js' ?>' type='text/javascript'> </script> <script type='text/javascript'> $(function() { $('.deleteTrigger').hover(function() { var button = $(this).find('button[name=delete_reply]'); $(button).show(); }, function() { var button = $(this).find('button[name=delete_reply]'); $(button).hide(); }); }); var nicEditorConfig = bkClass.extend({ buttons : { 'bold' : {name : __('Click to Bold'), command : 'Bold', tags : ['B','STRONG'], css : {'font-weight' : 'bold'}, key : 'b'}, 'italic' : {name : __('Click to Italic'), command : 'Italic', tags : ['EM','I'], css : {'font-style' : 'italic'}, key : 'i'}, 'underline' : {name : __('Click to Underline'), command : 'Underline', tags : ['U'], css : {'text-decoration' : 'underline'}, key : 'u'}, 'left' : {name : __('Left Align'), command : 'justifyleft', noActive : true}, 'center' : {name : __('Center Align'), command : 'justifycenter', noActive : true}, 'right' : {name : __('Right Align'), command : 'justifyright', noActive : true}, 'justify' : {name : __('Justify Align'), command : 'justifyfull', noActive : true}, 'ol' : {name : __('Insert Ordered List'), command : 'insertorderedlist', tags : ['OL']}, 'ul' : {name : __('Insert Unordered List'), command : 'insertunorderedlist', tags : ['UL']}, 'subscript' : {name : __('Click to Subscript'), command : 'subscript', tags : ['SUB']}, 'superscript' : {name : __('Click to Superscript'), command : 'superscript', tags : ['SUP']}, 'strikethrough' : {name : __('Click to Strike Through'), command : 'strikeThrough', css : {'text-decoration' : 'line-through'}}, 'removeformat' : {name : __('Remove Formatting'), command : 'removeformat', noActive : true}, 'indent' : {name : __('Indent Text'), command : 'indent', noActive : true}, 'outdent' : {name : __('Remove Indent'), command : 'outdent', noActive : true}, 'hr' : {name : __('Horizontal Rule'), command : 'insertHorizontalRule', noActive : true} }, iconsPath : '<?= Flux::config('BaseURI').FLUX_ADDON_DIR.'/support/themes/'.Flux::config('ThemeName').'/img/nicEditorIcons.gif' ?>', buttonList : ['save','bold','italic','underline','left','center','right','justify','ol','ul','fontSize','fontFamily','fontFormat','indent','outdent','image','upload','link','unlink','forecolor','bgcolor'], iconList : {"bgcolor":1,"forecolor":2,"bold":3,"center":4,"hr":5,"indent":6,"italic":7,"justify":8,"left":9,"ol":10,"outdent":11,"removeformat":12,"right":13,"save":24,"strikethrough":15,"subscript":16,"superscript":17,"ul":18,"underline":19,"image":20,"link":21,"unlink":22,"close":23,"arrow":25,"upload":26} }); ; //<![CDATA[ bkLib.onDomLoaded(function() { new nicEditor().panelInstance('reply'); }); //]]> </script> <?php else: ?> <p class='message'><?= Flux::message('TicketNotExists') ?></p> <?php endif ?>
-
Thank you so much Annie, thanks to you I got the script working now! - Solved -
-
Thank you Annie pet_class worked! I'm very close now. Strange problem I noticed, it ignores my menu choice. It always only spawns the first monster in the list regardless of the monster/pet I picked in the menu. Which is weird because in this dialogue it shows fine. mes "[battle Arena]"; mes "Pet: "+ [email protected]_name$[[email protected]]; mes "Level : "+ [email protected]_level[[email protected]]; Example; I picked Drops (second option in the menu), Drops would show fine ^there, but it would spawn a Poring (first item in the list/menu)...
-
This entire line works, except for the ID. I want the ID to be determined on the monster the player selected in the menu. (my pet ID and monster ID are the same.) What I don't understand is, why getd("[email protected]_name$[[email protected]]") is working (as in, the name shows up properly), but getd("[email protected]_id[[email protected]]") is not working. Can someone please tell me where I went wrong? Thank you very much. monster "gon_test", 62, 86, getd("[email protected]_name$[[email protected]]"), getd("[email protected]_id[[email protected]]"), 1,strnpcinfo(0)+"::Dead",0,1;
-
Yes I suppose you can compare it with a Pokemon battle system. I do not intent to actually summon the pet you pick in the menu, but to summon the actual monster in mob_db it is attached to. The menu would just be to pick one of them. Is it possible to do that, with (for example) arrays? Like create a link between a pet/egg and monsters in mob_db? (something like the evolution script you made for that other person). To be honest I don't really know what the limitations are but it'd be nice if it could work... For your second comment; yes the monsters are hostile but (in this case) Test mob 1 and Test mob 2 do NOT target the player (extensively tested), the monsters target eachother (however if you're in range, you will receive damage from AoE skills). Also here is the link i am trying to base the script of: http://rathena.org/board/topic/74316-event-mvp-vs-mvp/ - only difference is a menu with options.. xD ---------------------------------------- *edit* the menu works, Now i just need to know how I can let the monster spawn determine on the ID i picked. Does someone know what I put here?: monster "gon_test", 62, 86,[email protected]_name[[email protected]]+", [email protected]_id[[email protected]]+", 1,strnpcinfo(0)+"::Dead",0,1; Help is much appreciated!!
-
Thanks annie! I have another request if I may. Also about pets. ^^; I used a part of your script to make this happen, but it errors me at getinventorylist; What i want is when "petattack" is whispered, that a menu pops up, player can pick a loyal pet and itll be summoned. As you can see the script isn't finished at all and lacks codes... but I hope for your kindness to help me. - script petattack -1,{ OnWhisperGlobal: if (getgroupid() < 99) close; mes "Which Pet do you want to summon?"; next; } getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected]++ ) { if ( @inventorylist_card1[[email protected]] == -256 ) { query_sql "select intimate, class, level, equip, name from pet where pet_id = "+( [email protected] = @inventorylist_card2[[email protected]] + ( ( @inventorylist_card2[[email protected]] >= 0 )? 0 : 1 << 16 ) + @inventorylist_card3[[email protected]] * ( 1 << 16 ) ), [email protected], [email protected], [email protected], [email protected], [email protected]$; if ( [email protected] > .pet_min_friendly ) { [email protected]$ = [email protected]$ +"^0000FF"+ [email protected]$ +"^000000" +":"; [email protected]_id[[email protected]] = [email protected]; [email protected]_id[[email protected]] = @inventorylist_id[[email protected]]; [email protected]_name$[[email protected]] = [email protected]$; [email protected]_class[[email protected]] = [email protected]; [email protected]_level[[email protected]] = [email protected]; [email protected]_equipped[[email protected]] = [email protected]; [email protected]++; } } } if ( [email protected] ) { mes "No loyal pet with you."; close; } mes "[Pet Battle]"; mes "Select the pet that you want to summon:"; [email protected] = select( [email protected]$ ) -1; next; mes "[Pet Battle]"; mes "Pet: "+ [email protected]_name$[[email protected]]; mes "Level : "+ [email protected]_level[[email protected]]; mes " "; menu "- Summon",-; if ( getd( ".petr"+ [email protected]_class[[email protected]] ) ) { mes "require :-"; [email protected] = getarraysize( getd( ".petr"+ [email protected]_class[[email protected]] ) ); for ( [email protected] = 0; [email protected] < [email protected]; [email protected] += 2 ) mes getd( ".petr"+ [email protected]_class[[email protected]] +"["+( [email protected] +1 )+"]" )+"x "+ getitemname( getd( ".petr"+ [email protected]_class[[email protected]] +"["+ [email protected] +"]" ) ); } monster "gon_test", 62, 86, "Test pet1", 1647, 1,strnpcinfo(0)+"::Dead",0,1; sleep2 100; monster "gon_test", 52, 86, "Test pet2", 1785, 1,strnpcinfo(0)+"::Dead",0,0; OnInit: .pet_min_friendly = getbattleflag("pet_support_min_friendly"); .min_level = 60; // minimum level 60 to do 1st evolutions end; } } }
-
Hello rAthena. I have a problem with this script (originally by AnnieRuru). In this menu, it shows each pet in my possession. But what I want is to only make it show the pets with 1000 intimacy / loyalty. Can someone please take a look at it and help me how to do that? Thank you very much. edit* To clarify, I know getpetinfo would do the trick, but I need the script to check the intimacy as the pet is in its EGG and not outside of it, hence why getpetinfo does not work. getinventorylist; for ( [email protected] = 0; [email protected] < @inventorylist_count; [email protected]++ ) { if ( @inventorylist_card1[[email protected]] == -256 ) { query_sql "select class, level, equip, name from pet where pet_id = "+( [email protected] = @inventorylist_card2[[email protected]] + ( ( @inventorylist_card2[[email protected]] >= 0 )? 0 : 1 << 16 ) + @inventorylist_card3[[email protected]] * ( 1 << 16 ) ), [email protected], [email protected], [email protected], [email protected]$; [email protected]$ = [email protected]$ +"^0000FF"+ [email protected]$ +" ^00CC00["+ getmonsterinfo( [email protected], 0 ) +"] ^000000["+ [email protected] +"] ^FF0000"+( ( [email protected] )? "*equipped" : "" )+":"; [email protected]_id[[email protected]] = [email protected]; [email protected]_id[[email protected]] = @inventorylist_id[[email protected]]; [email protected]_name$[[email protected]] = [email protected]$; [email protected]_class[[email protected]] = [email protected]; [email protected]_level[[email protected]] = [email protected]; [email protected]_equipped[[email protected]] = [email protected]; [email protected]++;
-
I'm looking for a simply quest template like the (grape-, orange-, apple-, etc) juices. Tried to copy that one and modify it but no luck.. Little example, you bring 5x red potion, 5x orange potion, 5x yellow potion and 5x white potion and 20k Zeny and it'll give you 5x blue potion in return. This is the important part, I want it to have a option in the menu that says "Create as many as I can make". It'll check on the inventory how many items you have, say you have 52 of each, it'll give you 10 blue potions. If you have 55 and it'll give you 11, if you have 50 of all beside red potion which you only have 10 from, it'll only give 2 blue potions. Pretty much the Marx Hansen script in juice_maker.txt but with more items/ingredients. Thank you very much!
-
Euphy's script was the default one that came along in my SVN. everything else works, just the reward is odd. for goddamet script, i thought so at first too but that can't be. Guilds can only own max. 1 castle on my server. this is the script i used: //Author : Goddameit //Version : 2012/06/24 - 04:19 //Web : http://goo.gl/8Nedn /* I added some checks to make sure that will not happen some errors what I didn't expect for. Test in eA15*** SQL */ function script AllGuildMemberEvent { if(!set([email protected],getcastledata(getarg(0),1))) return; query_sql("select account_id, char_id from `guild_member` where guild_id = '"[email protected]+"'", [email protected], [email protected]); set [email protected],getarraysize([email protected]); for(set [email protected],0;[email protected]<[email protected];set [email protected],[email protected]+1) { if([email protected][[email protected]]) continue; query_sql("select last_ip from `login` where account_id = '"[email protected][[email protected]]+"'",[email protected]$); query_sql("select account_id from `login` where last_ip= '"[email protected]$+"'",[email protected]); set [email protected],getarraysize([email protected]); for(set [email protected],1;[email protected]<[email protected];set [email protected],[email protected]+1) { for(set [email protected],0;[email protected]<[email protected];set [email protected],[email protected]+1) { if([email protected][[email protected]][email protected][[email protected]]) { set [email protected][[email protected]],0; set [email protected][[email protected]],0; } } } if(attachrid([email protected][[email protected]])) { message strcharinfo(0),"Your guild has won this War of Emperium!"; getitem 6419,3; detachrid; } } return; } - script AGME -1,{ OnAgitEnd: setarray [email protected]$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05", "gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05", "payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05", "prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05"; for( set [email protected],0; [email protected] <= 19; set [email protected], [email protected]+1) { callfunc "AllGuildMemberEvent",[email protected]$[[email protected]]; } end; }
-
Hi rAthena I have a request, I tried several woe reward scripts but none of them works like I want. Goddammets script gave the players like 20+ items while I set the getitem id to 3. Me and my players presume it rewards on the kills they made. Euphy's reward setter/script for some reason rewarded the losing guild instead of the winning guild.... idk if it's a bug on my servers end but other than setting the reward ID and prize, I haven't touched the script at all... x_x Can someone please, please give me a script that the guilds that end up with a castle after woe get 3 of a certain item?
-
I would like to suggest a "Paid Request" section were members/server owners can briefly post what they need. Then members that are willing to apply for the task can simply hit them up and discuss the details such as a price and what-so-ever. The reason for this is because my personal experience with the paid services section isn't all that great, I've had it happen several times that I messaged someone who posted in there but they never gotten back to me. Shamefully enough, some of the members in question were even Devs - they read the message, but just never responded, while it was clearly a service they said they offered. Any thoughts about this?
-
No one?
-
Hello rAthena, Could anyone help me here? I'm using I believe Annie's PvP ladder, but the kills and deaths are going so weird... When I log back in after a night of sleeping, someone that previously had 0 kills and 6 deaths, suddenly has 2 kills and 2 deaths. Another thing is sometime when a player crashes all his pvp stats reset. :/ I really just want it to function properly... if that's impossible could someone direct me to another simple pvp ladder similar to this one? Thanks! Here is the script. Help is very much appreciated! - script job_pvp -1,{ OnInit: // only 1 config lol set .gmnokill, 0; // GMs are not suppose to kill players. A GM with <this number> level or higher will do nothing. IF set to 60, GM60 and above kill any player will not get anything : 0 - off if ( .gmnokill <= 0 ) set .gmnokill, 101; // prevent bug end; OnPCKillEvent: if ( @pvpl_deaths ) end; //else if ( getgmlevel() >= .gmnokill ) end; set @pvpl_deaths, @pvpl_deaths +1; query_sql "replace delayed into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql(strcharinfo(0)) +"', "+ @pvpl_kills +", "+ @pvpl_deaths +", "+ class +" )"; if ( killerrid == getcharid(3) ) end; // kill himself(like grandcross) doesn't add kills count donpcevent "PvP Ranker::OnInit"; end; OnPCDieEvent: if ( @pvpl_kills ) end; set @pvpl_kills, @pvpl_kills +1; query_sql "replace delayed into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql(strcharinfo(0)) +"', "+ @pvpl_kills +", "+ @pvpl_deaths +", "+ class +" )"; donpcevent "PvP Ranker::OnInit"; end; OnPCLoadMapEvent: if ( @pvpl_kills || @pvpl_deaths ) end; query_sql "select kills, deaths from pvpladder where char_id = "+ getcharid(0), @pvpl_kills, @pvpl_deaths; end; } prontera,146,174,6 script PvP Ranker 733,{ while(1) { mes "[PvP Ranker]"; mes "Hi, "+ strcharinfo(0); mes "What can I do for you?"; next; menu "Display the PvP Ladder",-; set [email protected], query_sql("select name, kills, deaths, class from pvpladder order by kills"+( (@menu == 2)?"/deaths":" desc" )+" limit 10", [email protected]$, [email protected], [email protected], [email protected] ); mes "[^006699Name^000000] - [^00AA00Kills^000000] - [^FF0000Deaths^000000]"; for ( set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] +1 ) mes "^996600"+ ([email protected]+1) +")^000000 [^006699"+ [email protected]$[[email protected]] +"^000000] - [^00AA00"+ [email protected][[email protected]] +"^000000] - [^FF0000"+ [email protected][[email protected]] +"^000000]"; close; if ( [email protected] == 0 ) mes "The PvP Ladder is empty"; close; } end; OnInit: delwaitingroom strnpcinfo(1); set [email protected], query_sql("select name, kills from pvpladder order by kills desc limit 1", [email protected]$, [email protected] ); waitingroom "#1 Player: "+ [email protected]$ +" ("+ [email protected] +" kills)",0; end; }
-
Ghost pvp ladder is counting monster deaths. Help please.
Helena replied to Helena's question in Scripting Support
Yes that'd be nice indeed... An update about this topic; I went with Annie's PvP ladder. An ancient script but hey it still works fine. Thanks for the help. Closing this. ^^ -
Ghost pvp ladder is counting monster deaths. Help please.
Helena posted a question in Scripting Support
Hello everyone, I'm here to request some help. I am using Ghost pvp ladder script, but monster deaths are also being counted... :/ Can someone please assist me to help me make it only count it on players? Thank you. - script Versus -1,{ OnInit: //--Configuration set .System, 1; //Toggle PvP System (0:Disable|1:Enable) set .ServerType, 1; //Are you using TXT or SQL? (0:TXT|1:SQL) set .GMLevel, 90; //GM levels above or equal this level will be ignored by the system setarray .PvPMap$[0], "All"; //List all pvp maps here (Index 0:"All" to enable all maps) //PvP Ladder set .Top, 10; //What is the length of the list? set .Reset, 2; //Allow players to reset their PvP statistics? (0:Disable|1:Zeny|2:Cashpoint|3:Skull) set .ZenyFee, 0; //How much zeny you want to charge to reset their pvp stat? set .CashFee, 3; //How much cashpoint you want to charge to reset their pvp stat? set .SkullFee, 0; //How much skull you want to charge to reset their pvp stat? set .AnnouncerFee, 0; //How much cashpoint per announcer? (DotA announcer is set as default) //Reward Setting (Every Kill) set .MaxZeny, 1000000000; //What is the max zeny of the server? set .Zeny, 0; //Earn zeny each kill? (0:Disable) set .Cash, 0; //How much #CASHPOINT every kill? (0:Disable) set .Skull, 1; //Collect player's skull each kill? (0:Disable|1:Enable) setarray .ItemID[0], 0; //Get items each kill? (0:Disable) setarray .Amount[0], 0; //How many items per kill? //Penalty Setting set .Feed, 10; //How many kills before feeding is called? (10:Recommended) set .Penalty, 1; //What is the penalty for the feedee? (0:Disable|1:Kill Rollback|2:Server Kick|3:Server Block) set .Kick, 0; //Who to kick? (0:Feedee|1:Feeder|2:Both) set .Rollback, 10; //How many times should the kill count rollback when feeding is called? (10:Recommended) //Announcer Setting set .Broadcast, 0; //Where do you want to broadcast? (0:bc_all|1:bc_map) set .Streak, 1; //Show number of killing streak in broadcast? e.g. Ghost is Beyond Godlike(8) set .Multiple, 1; //Show number of multiple kill in broadcast? e.g. Makizushi just got an Ownage(5) set .Nemesis, 1; //Show number of nemesis in broadcast? e.g. Epoque is owning Jguy(9) set .Feeder, 1; //Show number of feed in broadcast? e.g. Cookies is feeding `KeiKun(10) set .RandomKillWord, 0; //Randomize the kill words? e.g. Arcenciel "Kill Word" jTynne (0:Disable|Default:"pwned") setarray .KillWord$[0], "pwned", "killed", "disintegrated", "neutralized"; //Enable above setting for this to work //Broadcast Color | See HexTable: http://johncfish.com/bggallery/otherchart/hextable.gif set .KColor$, "0xFFFF00"; //Kill Broadcast Color | e.g. Jguy pwned Mercurial set .KSColor$, "0xFFFF00"; //Killing Streak Broadcast Color | e.g. jTynne is on a Killing Spree set .MKColor$, "0x33FF00"; //Multiple Kill Broadcast Color | e.g. Mercurial just got a Double Kill set .ESColor$, "0xFF0000"; //End Streak Broadcast Color | e.g. BrianL just ended Jguy's Killing Spree set .NMColor$, "0x0099FF"; //Nemesis Broadcast Color | e.g. Xazax is owning Cookies set .PBColor$, "0xFF0000"; //Payback Broadcast Color | e.g. Makizushi just have a payback againts lilcooldude69 set .FDColor$, "0xFF00CC"; //Feeder Broadcast Color | e.g. Cookies is feeding Z3R0 //--Warning: Critical Setting | Killing Streaks and Multiple Kills Announcer setarray .KSDotA$[0], "is on a Killing Spree", "is Dominating", "has a Mega-Kill", "is Unstoppable", "is Wicked Sick", "has a M-m-m-m....Monster Kill", "is Godlike", "is Beyond Godlike"; setarray .KSHoN$[0], "is a Serial Killer", "is an Ultimate Warrior", "is Legendary", "is on an Onslaught!", "is Savage Sick", "is Dominating", "has a Bloodbath", "is Immortal"; //Took out #9. Champion of Newearth setarray .MKDotA$[0], "just got a Double Kill", "just got a Triple Kill", "just got an Ultra Kill", "is on a Rampage", "is Owning his enemies"; setarray .MKHoN$[0], "just got a Double Tap", "just got a Hat Trick", "just got an Quad Kill", "annihilated his enemies", "just got a Genocide"; setarray .ESDotA$[0], "Killing Spree", "Dominating", "Mega-Kill", "Unstoppable", "Wicked Sick", "Monster Kill", "Godlike", "Beyond Godlike"; setarray .ESHoN$[0], "Serial Killer", "Ultimate Warrior", "Legendary", "Onslaught", "Savage Sick", "Dominating", "Bloodbath", "Immortal"; //Took out #9. Champion of Newearth setarray .EMDotA$[0], "Double Kill", "Triple Kill", "Ultra Kill", "Rampage", "Ownage"; setarray .EMHoN$[0], "Double Tap", "Hat Trick", "Quad Kill", "Annihilation", "Genocide"; //--Warning: Fail Safe | Do Not Touch if(.System > 1){ set .System, 1; } if(.System < 0){ set .System, 0; } if(.ServerType > 1){ set .ServerType, 1; } if(.ServerType < 0){ set .ServerType, 0; } if(.GMLevel > 99){ set .GMLevel, 99; } if(.GMLevel < 0){ set .GMLevel, 0; } if((.PvPMap$[0] == "ALL")||(.PvPMap$[0] == "ALl")||(.PvPMap$[0] == "AlL")||(.PvPMap$[0] == "aLL")||(.PvPMap$[0] == "aLl") || (.PvPMap$[0] == "alL")){ setarray .PvPMap$[0], "All"; } if(.Ladder > 1){ set .Ladder, 1; } if(.Ladder < 0){ set .Ladder, 0; } if(.Top < 0){ set .Top, 0; } if(.Reset > 3){ set .Reset, 0; } if(.Reset < 0){ set .Reset, 0; } if((.Reset == 1)&&(.ZenyFee <= 0)){ set .Reset, 0; } if((.Reset == 1)&&(.ZenyFee >= .MaxZeny)){ set .Reset, 0; } if((.Reset == 2)&&(.CashFee <= 0)){ set .Reset, 0; } if((.Reset == 3)&&(.SkullFee <= 0)){ set .Reset, 0; } if(.Zeny > .MaxZeny){ set .Zeny, 0; } if(.Zeny < 0){ set .Zeny, 0; } if(.Cash < 0){ set .Cash, 0; } if(.Broadcast > 1){ set .Broadcast, 1; } if(.Broadcast < 0){ set .Broadcast, 0; } if(.Feed < 1){ set .Feed, 0; } if(.Penalty > 3){ set .Penalty, 3; } if(.Penalty < 1){ set .Penalty, 0; } if(.Rollback < 1){ set .Rollback, 0; } if(.Streak > 1){ set .Streak, 1; } if(.Streak < 1){ set .Streak, 0; } if(.Multiple > 1){ set .Multiple, 1; } if(.Multiple < 1){ set .Multiple, 0; } if(.Nemesis > 1){ set .Nemesis, 1; } if(.Nemesis < 0){ set .Nemesis, 0; } if(.Feeder > 1){ set .Feeder, 1; } if(.Feeder < 1){ set .Feeder, 0; } if(.RandomKillWord > 1){ set .RandomKillWord, 1; } if(.RandomKillWord < 0){ set .RandomKillWord, 0; } end; OnPCKillEvent: if(.System){ if(getgmlevel() >= .GMLevel){ end; } if(.PvPMap$[0] != "All"){ for(set [email protected], 0; [email protected] < (getarraysize(.PvPMap$) - 1); set [email protected], [email protected] + 1){ if(strcharinfo(3) != .PvPMap$[[email protected]]){ end; } } } if((@nm == .Feed) && (.Penalty)){ callsub OnClearData; switch(.Penalty){ case 0: break; case 1: callsub OnRollback; break; case 2: callsub OnRollback; if(.Kick == 0){ atcommand "@kick "+strcharinfo(0); } if(.Kick == 1){ atcommand "@kick "+rid2name(killedrid); } if(.Kick == 2){ atcommand "@kick "+strcharinfo(0); atcommand "@kick "+rid2name(killedrid); } break; case 3: callsub OnRollback; if(.Kick == 0){ atcommand "@block "+strcharinfo(0); } if(.Kick == 1){ atcommand "@block "+rid2name(killedrid); } if(.Kick == 2){ atcommand "@block "+strcharinfo(0); atcommand "@block "+rid2name(killedrid); } break; default: break; } } if(@nm < .Feed){ if(.Zeny && ((Zeny + .Zeny) < .MaxZeny)){ set Zeny, Zeny + .Zeny; } if(.Cash){ dispbottom "[Point System] +1 Kill Point"; set #CASHPOINT, #CASHPOINT + .Cash; } if(.Skull){ getnameditem 7420, rid2name(killedrid); } for(set [email protected], 0; [email protected] < getarraysize(.ItemID); set [email protected], [email protected] + 1){ if(.ItemID){ getitem .ItemID[[email protected]], .Amount[[email protected]]; }} } if(.RandomKillTerm){ announce strcharinfo(0)+" "+.KillWord$[rand(0, getarraysize(.KillWord$) - 1)]+" "+rid2name(killedrid)+"'s head", ((.Broadcast)?bc_all:bc_map), .KColor$; } else { announce strcharinfo(0)+" pwned "+rid2name(killedrid)+"'s head", ((.Broadcast)?bc_all:bc_map), .KColor$; } set Kill, Kill + 1; if(@ks < 10){ set @ks, @ks + 1; } if(@mk < 6){ set @mk, @mk + 1; } if(!NemesisKilled){ set NemesisKilled, killedrid; } if(NemesisKilled == killedrid){ set @nm, @nm + 1; } deltimer "Versus::OnMKReset"; addtimer 18000, "Versus::OnMKReset"; callsub OnRecordStreak; callsub OnAnnounce; callsub OnDeath; end; } end; OnPCDieEvent: if( .System ){ if(getgmlevel() < .GMLevel) if(.PvPMap$[0] != "All"){ set [email protected],getarraysize(.PvPMap$); set [email protected]$,strcharinfo(3); for(set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] + 1) if( [email protected]$ == .PvPMap$[[email protected]]){ set Death, Death + 1; break; } }else{ set Death, Death + 1; } } end; OnPCLogoutEvent: if(.System){ if(getgmlevel() >= .GMLevel){ end; } if((.ServerType) && (Kill)){ query_sql("REPLACE INTO `pvp_rank` (`char_id`, `account_id`, `char`, `kill`, `death`, `kdr`, `killingstreak`, `multikill`, `nemesiskill`, `feedcount`,`killingspree`, `dominating`, `megakill`, `unstoppable`, `wickedsick`, `monsterkill`, `godlike`, `beyondgodlike`, `doublekill`, `triplekill`, `ultrakill`, `rampage`, `ownage`) VALUES ("+getcharid(0)+","+getcharid(3)+", '"+rid2name(getcharid(3))+"', "+Kill+", "+Death+", '"+callfunc("KDR_Calc", Kill, Death)+"', "+KillingStreak+", "+MultiKill+", "+NemesisKill+", "+FeedCount+", "+KillingSpree+", "+Dominating+", "+MegaKill+", "+Unstoppable+", "+WickedSick+", "+MonsterKill+", "+Godlike+", "+BeyondGodlike+", "+DoubleKill+", "+TripleKill+", "+UltraKill+", "+Rampage+", "+Ownage+")"); } if(.PvPMap$[0] != "All"){ for(set [email protected], 0; [email protected] < (getarraysize(.PvPMap$) - 1); set [email protected], [email protected] + 1){ if(strcharinfo(3) != .PvPMap$[[email protected]]){ end; } } } callsub OnClearData; deltimer "Versus::OnMKReset"; } end; OnRecordStreak: if(@ks > 2){ set KillingStreak, KillingStreak + 1; switch(@ks){ case 0: case 1: case 2: break; case 3: set KillingSpree, KillingSpree + 1; break; case 4: set Dominating, Dominating + 1; break; case 5: set MegaKill, MegaKill + 1; break; case 6: set Unstoppable, Unstoppable + 1; break; case 7: set WickedSick, WickedSick + 1; break; case 8: set MonsterKill, MonsterKill + 1; break; case 9: set Godlike, Godlike + 1; break; case 10: set BeyondGodlike, BeyondGodlike + 1; break; default: break; } } if(@mk > 1){ set MultiKill, MultiKill + 1; switch(@mk){ case 0: case 1: break; case 2: set DoubleKill, DoubleKill + 1; break; case 3: set TripleKill, TripleKill + 1; break; case 4: set UltraKill, UltraKill + 1; break; case 5: set Rampage, Rampage + 1; break; case 6: set Ownage, Ownage + 1; break; default: break; } } if((@nm > 3) && (@nm < .Feed)){ set NemesisKill, NemesisKill + 1; } if(@nm >= .Feed){ set FeedCount, FeedCount + 1; } return; OnAnnounce: if((@ks == 1) && (#FirstBlood == 1)){ if(#Announcer == 0){ announce strcharinfo(0)+" drew first blood", ((.Broadcast)?bc_all:bc_map), .KSColor$; } if(#Announcer > 1){ announce strcharinfo(0)+" got bloodlust", ((.Broadcast)?bc_all:bc_map), .KSColor$; } set #FirstBlood, 0; soundeffectall ""+#Announcer+"_KS"+1+".wav", 0, strcharinfo(3); } if(@ks > 2){ if(#Announcer == 0){ announce strcharinfo(0)+" "+.KSDotA$[@ks - 3]+" "+((.Streak)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .KSColor$; } if(#Announcer > 1){ announce strcharinfo(0)+" "+.KSHoN$[@ks - 3]+" "+((.Streak)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .KSColor$; } soundeffectall ""+#Announcer+"_KS"[email protected]+".wav", 0, strcharinfo(3); } if(@mk > 1){ if(#Announcer == 0){ announce strcharinfo(0)+" "+.MKDotA$[@mk - 2]+" "+((.Multiple)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .MKColor$; } if(#Announcer > 1){ announce strcharinfo(0)+" "+.MKHoN$[@mk - 2]+" "+((.Multiple)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .MKColor$; } sleep2 1500; soundeffectall ""+#Announcer+"_MK"[email protected]+".wav", 0, strcharinfo(3); } if((@nm > 3) && (@nm < .Feed)){ announce strcharinfo(0)+" is owning "+rid2name(NemesisKilled)+" "+((.Nemesis)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .NMColor$; sleep2 2000; if(#Announcer > 0){ soundeffectall #Announcer+"_Nemesis.wav", 0, strcharinfo(3); } else { soundeffectall "1_Nemesis.wav", 0;} } if(@nm >= .Feed){ announce rid2name(NemesisKilled)+" is feeding "+strcharinfo(0)+" "+((.Feeder)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .FDColor$; sleep2 1500; soundeffectall "Feeder.wav", 0, strcharinfo(3); } return; OnDeath: if(@ks > 2){ if(#Announcer == 0){ announce rid2name(killedrid)+" just ended "+strcharinfo(0)+"'s "+.ESDotA$[@ks - 3]+" "+((.Streak)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .ESColor$; } if(#Announcer > 1){ announce rid2name(killedrid)+" just ended "+strcharinfo(0)+"'s "+.ESHoN$[@ks - 3]+" "+((.Streak)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .ESColor$; } } if(@nm > 3){ soundeffectall #Announcer+"_Payback.wav", 0, rid2name(killedrid); announce rid2name(killedrid)+" just have a payback againts "+strcharinfo(0)+" "+((.Nemesis)?"("[email protected]+")":"")+"", ((.Broadcast)?bc_all:bc_map), .PBColor$; } attachrid(killedrid); callsub OnClearData; return; OnMKReset: set @mk, 0; end; OnClearData: sleep2 3000; set NemesisKilled, 0; set @ks, 0; set @mk, 0; set @nm, 0; return; OnRollback: if(.Zeny){ set Zeny, Zeny - (.Zeny * .Rollback); } if(.Cash){ dispbottom "[Point System] -"+(.Cash * .Rollback)+" Kill Point"; set #CASHPOINT, #CASHPOINT - (.Cash * .Rollback); } if(.Skull){ delitem 7420, .Rollback; } for(set [email protected], 0; [email protected] < getarraysize(.ItemID); set [email protected], [email protected] + 1){ if(.ItemID){ delitem .ItemID[[email protected]], .Amount[[email protected]] * .Rollback; }} if((Kill - .Rollback) > 0){ set Kill, Kill - .Rollback; } else { set Kill, 0; } if((KillingSpree - 1) > 0){ set KillingSpree, KillingSpree - 1; } else { set KillingSpree, 0; } if((Dominating - 1) > 0){ set Dominating, Dominating - 1; } else { set Dominating, 0; } if((MegaKill - 1) > 0){ set MegaKill, MegaKill - 1; } else { set MegaKill, 0; } if((Unstoppable - 1) > 0){ set Unstoppable, Unstoppable - 1; } else { set Unstoppable, 0; } if((WickedSick - 1) > 0){ set WickedSick, WickedSick - 1; } else { set WickedSick, 0; } if((MonsterKill - 1) > 0){ set MonsterKill, MonsterKill - 1; } else { set MonsterKill, 0; } if((Godlike - 1) > 0){ set Godlike, Godlike - 1; } else { set Godlike, 0; } if((BeyondGodlike - 1) > 0){ set BeyondGodlike, BeyondGodlike - 1; } else { set BeyondGodlike, 0; } if((DoubleKill - 1) > 0){ set DoubleKill, DoubleKill - 1; } else { set DoubleKill, 0; } if((TripleKill - 1) > 0){ set TripleKill, TripleKill - 1; } else { set TripleKill, 0; } if((UltraKill - 1) > 0){ set UltraKill, UltraKill - 1; } else { set UltraKill, 0; } if((Rampage - 1) > 0){ set Rampage, Rampage - 1; } else { set Rampage, 0; } if((Ownage - 1) > 0){ set Ownage, Ownage - 1; } else { set Ownage, 0; } if((NemesisKill - (.Rollback - 3)) > 0){ set NemesisKill, NemesisKill - (.Rollback - 3); } else { set NemesisKill, 0; } announce "[Anti-Feed] Your kill count has been rollbacked "+.Rollback+" times.",bc_self,0xFF0000; return; } quiz_test,95,84,5 script PvP Ranking 733,{ mes "[Loki]"; mes "What can I do for you today?"; switch(select("Player Ranking:PvP Statistic:Announcer Setting")){ case 1: //Player Ranking next; if(getvariableofnpc(.ServerType, "Versus")){ mes "[Top "+getvariableofnpc(.Top, "Versus")+" PvP Players]"; mes "Name | ^0000FFKill^000000 | ^FF0000Death^000000 | ^FF22FFKD^000000 | ^00FF00SK^000000 | ^666666MK^000000"; query_sql "SELECT `char`, `kill`, `death`, `kdr`, `killingstreak`, `multikill` FROM `pvp_rank` ORDER BY `pvp_rank`.`kill` DESC LIMIT "+getvariableofnpc(.Top, "Versus")+"", [email protected]$, [email protected], [email protected], [email protected]$, [email protected], [email protected]; for(set [email protected], 0; [email protected] < getarraysize([email protected]$); set [email protected], [email protected] + 1){ mes [email protected]+1+". "[email protected]$[[email protected]]+" | ^0000FF"[email protected][[email protected]]+"^000000 | ^FF0000"[email protected][[email protected]]+"^000000 | ^FF22FF"[email protected]$[[email protected]]+"^000000 | ^00FF00"[email protected][[email protected]]+"^000000 | ^666666"[email protected][[email protected]]+"^000000 "; } close; } else { mes "Top "+getvariableofnpc(.Top, "Versus")+" ranking is not yet implemented for this server type."; } case 2: //PvP Statistic next; mes strcharinfo(0)+"'s PvP Statistic"; mes "^666666Kill:^000000 "+Kill+" ^666666Death:^000000 "+Death+" ^666666KDR:^000000 "+callfunc("KDR_Calc", Kill, Death)+"^000000"; mes "^666666Killing Streak:^000000 "+KillingStreak+" ^666666Multi-Kills:^000000 "+MultiKill+""; switch(select("Killing Streak:Multi-Kill Streak:Nemesis Streak:"+(getvariableofnpc(.Reset, "Versus")?"Reset":"")+"")){ case 1: //Killing Streak next; setarray .LSDotA$[0], ""+KillingSpree+"", ""+Dominating+"", ""+MegaKill+"", ""+Unstoppable+"", ""+WickedSick+"", ""+MonsterKill+"", ""+Godlike+"", ""+BeyondGodlike+""; mes "Killing Streak Stats"; switch(#Announcer){ case 0: for(set [email protected], 0; [email protected] < getarraysize(.LSDotA$); set [email protected], [email protected] + 1){ mes "^666666"+getvariableofnpc(.ESDotA$[[email protected]], "Versus")+"^000000: "+ .LSDotA$[[email protected]]; } close; default: for(set [email protected], 0; [email protected] < getarraysize(.LSDotA$); set [email protected], [email protected] + 1){ mes "^666666"+getvariableofnpc(.ESHoN$[[email protected]], "Versus")+"^000000: "+ .LSDotA$[[email protected]]; } close; } close; case 2: //Multi-Kill next; setarray .LMDotA$[0], ""+DoubleKill+"", ""+TripleKill+"", ""+UltraKill+"", ""+Rampage+"", ""+Ownage+""; mes "Multi-Kill Stats"; switch(#Announcer){ case 0: for(set [email protected], 0; [email protected] < getarraysize(.LMDotA$); set [email protected], [email protected] + 1){ mes "^666666"+getvariableofnpc(.EMDotA$[[email protected]], "Versus")+"^000000: "+ .LMDotA$[[email protected]]; } close; default: for(set [email protected], 0; [email protected] < getarraysize(.LMDotA$); set [email protected], [email protected] + 1){ mes "^666666"+getvariableofnpc(.EMHoN$[[email protected]], "Versus")+"^000000: "+ .LMDotA$[[email protected]]; } close; } case 3: //Nemesis next; mes "Nemesis Stat"; mes "^666666Nemesis Kill^000000: "+NemesisKill; mes "^666666Feed Count^000000: "+FeedCount; close; case 4: //Reset Stat next; set .Reset, getvariableofnpc(.Reset, "Versus"); set .ZenyFee, getvariableofnpc(.ZenyFee, "Versus"); set .CashFee, getvariableofnpc(.CashFee, "Versus"); set .SkullFee, getvariableofnpc(.SkullFee, "Versus"); mes "[Loki]"; mes "Are you sure you want to reset your PvP Statistics?"; if(.Reset == 1){ mes "^FF0000Reset Fee:^000000 "+.ZenyFee+" Zeny"; } if(.Reset == 2){ mes "^FF0000Reset Fee:^000000 "+.CashFee+" Kill Point"; } if(.Reset == 3){ mes "^FF0000Reset Fee:^000000 "+.SkullFee+" Skull"; } switch(select("No:Yes")){ case 1: close; case 2: switch(.Reset){ case 0: break; case 1: if(Zeny < .ZenyFee){ next; mes "[Loki]"; mes "You don't have enough Zeny."; close; } set Zeny, Zeny - .ZenyFee; break; case 2: if(#CASHPOINTS < .CashFee){ next; mes "[Loki]"; mes "You don't have enough Kill Point."; close; } set #CASHPOINTS, #CASHPOINTS - .CashFee; break; case 3: if(countitem(7420) < .SkullFee){ next; mes "[Loki]"; mes "You don't have enough Skull."; close; } delitem 7420, .SkullFee; break; default: break; } if(getvariableofnpc(.ServerType, "Versus")){ query_sql "DELETE FROM `pvp_rank` WHERE `pvp_rank`.`char_id` = "+getcharid(0)+""; } callsub OnPvPReset; announce "[Loki] Your PvP Statistic has been reset.",bc_self,0xFF0000; close; } close; } close; case 3: //Announcer Setting next; mes "[Loki]"; mes "What kind of announcer you want to use?"; if(getvariableofnpc(.AnnouncerFee, "Versus")){ set .AnnouncerFee, getvariableofnpc(.AnnouncerFee, "Versus"); } L_Announce: switch(select(""+((#Announcer == 0)?"^FF0000DotA^000000":"DotA")+":"+((#Announcer == 1)?"^FF0000HoN^000000":"HoN")+":"+((#Announcer == 2)?"^FF0000Ms. Pudding^000000":"Ms. Pudding")+":"+((#Announcer == 3)?"^FF0000Flamboyant^000000":"Flamboyant")+":"+((#Announcer == 4)?"^FF0000English^000000":"English")+":"+((#Announcer == 5)?"^FF0000Balls of Steel^000000":"Balls of Steel")+":"+((#Announcer == 6)?"^FF0000BreakyCPK^000000":"BreakyCPK")+"")){ case 1: //DotA if(#Announcer == 0){ goto L_Announce; } soundeffect "0_KS1.wav", 0; set #Announcer, 0; announce "[Loki] DotA announcer has been configured to your account.",bc_self,0xFF0000; close; case 2: //HoN if(#Announcer == 1){ goto L_Announce; } if((.AnnouncerFee) && (!#Hon)){ next; mes "[Loki]"; mes "Do you want to purchase HoN announcer for "+.AnnouncerFee+" Kill Point?"; switch(select("No:Yes")){ case 1: close; case 2: if(#CASHPOINTS < .AnnouncerFee){ next; mes "[Loki]"; mes "You don't have enough Kill Point."; close; } set #CASHPOINTS, #CASHPOINTS - .AnnouncerFee; set #Hon, 1; } } soundeffect "1_KS1.wav", 0; set #Announcer, 1; announce "[Loki] HoN announcer has been configured to your account.",bc_self,0xFF0000; close; case 3: //Ms. Pudding if(#Announcer == 2){ goto L_Announce; } if((.AnnouncerFee) && (!#MsPudding)){ next; mes "[Loki]"; mes "Do you want to purchase Ms. Pudding announcer for "+.AnnouncerFee+" Kill Point?"; switch(select("No:Yes")){ case 1: close; case 2: if(#CASHPOINTS < .AnnouncerFee){ next; mes "[Loki]"; mes "You don't have enough Kill Point."; close; } set #CASHPOINTS, #CASHPOINTS - .AnnouncerFee; set #MsPudding, 1; } } soundeffect "2_KS1.wav", 0; set #Announcer, 2; announce "[Loki] Ms. Pudding announcer has been configured to your account.",bc_self,0xFF0000; close; case 4: //Flamboyant if(#Announcer == 3){ goto L_Announce; } if((.AnnouncerFee) && (!#Flamboyant)){ next; mes "[Loki]"; mes "Do you want to purchase Flamboyant announcer for "+.AnnouncerFee+" Kill Point?"; switch(select("No:Yes")){ case 1: close; case 2: if(#CASHPOINTS < .AnnouncerFee){ next; mes "[Loki]"; mes "You don't have enough Kill Point."; close; } set #CASHPOINTS, #CASHPOINTS - .AnnouncerFee; set #Flamboyant, 1; } } soundeffect "3_KS1.wav", 0; set #Announcer, 3; announce "[Loki] Flamboyant announcer has been configured to your account.",bc_self,0xFF0000; close; case 5: //English if(#Announcer == 4){ goto L_Announce; } if((.AnnouncerFee) && (!#English)){ next; mes "[Loki]"; mes "Do you want to purchase English announcer for "+.AnnouncerFee+" Kill Point?"; switch(select("No:Yes")){ case 1: close; case 2: if(#CASHPOINTS < .AnnouncerFee){ next; mes "[Loki]"; mes "You don't have enough Kill Point."; close; } set #CASHPOINTS, #CASHPOINTS - .AnnouncerFee; set #English, 1; } } soundeffect "4_KS1.wav", 0; set #Announcer, 4; announce "[Loki] English announcer has been configured to your account.",bc_self,0xFF0000; close; case 6: //Balls of Steel if(#Announcer == 5){ goto L_Announce; } if((.AnnouncerFee) && (!#BallsofSteel)){ next; mes "[Loki]"; mes "Do you want to purchase Balls of Steel announcer for "+.AnnouncerFee+" Kill Point?"; switch(select("No:Yes")){ case 1: close; case 2: if(#CASHPOINTS < .AnnouncerFee){ next; mes "[Loki]"; mes "You don't have enough Kill Point."; close; } set #CASHPOINTS, #CASHPOINTS - .AnnouncerFee; set #BallsofSteel, 1; } } soundeffect "5_KS1.wav", 0; set #Announcer, 5; announce "[Loki] Balls of Steel announcer has been configured to your account.",bc_self,0xFF0000; close; case 7: //BreakyCPK if(#Announcer == 6){ goto L_Announce; } if((.AnnouncerFee) && (!#BreakyCPK)){ next; mes "[Loki]"; mes "Do you want to purchase BreakyCPK announcer for "+.AnnouncerFee+" Kill Point?"; switch(select("No:Yes")){ case 1: close; case 2: if(#CASHPOINTS < .AnnouncerFee){ next; mes "[Loki]"; mes "You don't have enough Kill Point."; close; } set #CASHPOINTS, #CASHPOINTS - .AnnouncerFee; set #BreakyCPK, 1; } } soundeffect "6_KS1.wav", 0; set #Announcer, 6; announce "[Loki] BreakyCPK announcer has been configured to your account.",bc_self,0xFF0000; close; default: close; } end; } close; OnPvPReset: set Kill, 0; set Death, 0; set KillingStreak, 0; set MultiKill, 0; set KillingSpree, 0; set Dominating, 0; set MegaKill, 0; set Unstoppable, 0; set WickedSick, 0; set MonsterKill, 0; set Godlike, 0; set BeyondGodlike, 0; set DoubleKill, 0; set TripleKill, 0; set UltraKill, 0; set Rampage, 0; set Ownage, 0; set NemesisKill, 0; set FeedCount, 0; return; } function script KDR_Calc { if(!getarg(1)) { debugmes "Error in KDR function, getarg(1) invalid value"; return 0; } // [Lighta] if(getarg(0) >= getarg(1)){ if(getarg(1)){ set [email protected], getarg(0)/getarg(1); if((getarg(0)%getarg(1)) == 0){ return [email protected]+".00"; } set [email protected], (getarg(0)%getarg(1))*100/getarg(1); return [email protected]+"."[email protected]; } else { return getarg(0)+".00"; } } if(getarg(0) < getarg(1)){ if(getarg(0)){ set [email protected], (getarg(0)*10)/getarg(1); set [email protected], ((getarg(0)*10)%getarg(1))*10/getarg(1); return "0."[email protected] [email protected]; } else { return "0.00"; } } }