Mistique
Members-
Posts
53 -
Joined
-
Last visited
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Mistique
-
Revert 'skip service select' diff/hex?
Mistique replied to Mistique's question in Client-side Support
Thank you thank you thank you! -
Revert 'skip service select' diff/hex?
Mistique replied to Mistique's question in Client-side Support
Sorry! I re-uploaded it. -
Revert 'skip service select' diff/hex?
Mistique replied to Mistique's question in Client-side Support
Thank you so much Functor! http://www.mediafire.com/file/2vxo4nfm60eu2t7/TestServer.rar/file -
Hi! I've checked this diff in the past and was wondering if there's a way I can un-do it without having to hex a client from scratch? My client has a lot of mods and other custom edits that I don't wish to lose. Any help will be greatly appreciated!
-
Inventory maximum description
Mistique replied to christofereduardo's question in Client-side Support
My apologies for necro-bumping this but I am looking for the same. Functor, would you know the HEX code to change it for 2016-12-28aRagexeRE ? I cannot find that hex string. -
Hello! Maybe I am asking something very complex here, but I am looking for a simple custom skill that when using it, prompts a window like pharmacy/weapon refine and lets me create items from produce_db.txt Practically the same as a npc quest script but through skill. It would go like this: 1) Click custom skill (10sp per use) 2) Menu pops up with available items to generate (defined in produce_db) 3) Select item in the menu 4) Checks for materials (defined in produce_db) 5) If all there> create item. There don't need to be fancy calculations, success rate increases or points to store in a list like the pharmacy/weapon refine skills (/alchemist, /blacksmith). Oh! And unlike pharmacy and weapon refine I prefer not to have the generated items named (i.e 'Mistique's Coat') so it will still allow me to slot them. Could anyone help me out please?
-
Hi all. I am having a problem that I can't find the problem of- When I equip any (official or custom) robe costume in-game it works perfectly fine. No sprite or texture errors. Then, however, when I ESC and move back to character selection, it would crash the client. Logging in normally to an account with a garment costume would crash the client upon character selection too. What's odd is that when I log into another account (without character that has a robe costume equipped), open the 4, 5 and 6 character slot window, then disconnect from it and re-connect with the account that has the character with the costume garment and with it navigate back to the 1, 2 and 3 character slot window, the client doesn't crash. O.o What could be the cause of this?
-
Cash Shop item payment instead of Cash Points?
Mistique replied to Mistique's question in Source Support
Hi anacondaq, sorry for the super delayed reply. Completely forgot this thread was here. I went through the steps you pointed out above once more but it still gives the same error message. battle_conf was not declared. I can't/prefer not to update my rA. Do you happen to have any suggestion how I could fix this error manually? Thanks. -
Hey, thanks! I've tried it, but unfortunately it doesn't work. Both characters still get warped to valkyrie (even the one outside the instance map), but neither of them get an item rewards. I should add the map does have a '@' in it like all instance maps, so that can't be the problem.
-
Hey @Alayne awesome collection! Is there any chance you can help me out with this? Here the reward code as well as the finished instance code. The problem is, players that aren't in the instance map but are in the instance party can basically hoard rewards while not doing anything. What I want is that only the players/party members in the instance map can benefit from the reward. As of now they get points as well as warped while they may not even be present in the instance map. That shouldn't be right. Thanks in advance. OnFinished: instance_announce instance_id(), "Congratulation! You have completed the challenge!",bc_map,"0x00ff99"; sleep2 2000; instance_announce instance_id(), "You'll soon be warped to Valhalla",bc_map,"0x00ff99"; sleep2 2000; instance_destroy AA_INSTANCE_ID; getpartymember getcharid(1),2; copyarray [email protected], [email protected], [email protected]; detachrid; for ( set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] +1 ) { if (attachrid([email protected][[email protected]])) { callfunc("AddPointsFixed", getcharid(3), 1 * $difficulty_level); set AARENA, AARENA + 1; warp "valkyrie",49,48; } } getpartymember getcharid(1),2; for( set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected]+1 ) if( attachrid( [email protected][[email protected]] ) && AA_INSTANCE_ID > 0){ set AA_INSTANCE_ID, -1; } } function script AddPointsFixed { if(instance_mapname(strcharinfo(3)) != instance_mapname("[email protected]") ){end;} set [email protected], getarg(0); set [email protected], getarg(1); getitem 677, 3; message rid2name([email protected]), "[ Instance ] : You've obtained 3 Coin(s) for completing instance!"; return; }
-
What file is responsible for 'Wear Costume' button?
Mistique replied to Mistique's question in Client-side Support
Hi Tokei. Thanks for your reply! That's right, the preview/wear costume button. How the item is received? Hmm, ok. you're right, I noticed that the preview button doesn't appear in the cash shop interface nor when players are vending costumes. However, when I purchase the items through the CS or their vend stand and they appear in my inventory, it does show the button. Yet, not for all IDs, which I still find strange if they're obtained the same way? I could take ID 20286 and copy/paste it into 20285 both server and client side and generate both through the @item command- 20286 would have the button while 20285 would not, isn't that odd? Awesome, thanks for helping me locate the file! That's exactly what I needed to know. I'm having a similar problem now... exactly the opposite. I've created a custom item (ID 20207) that is no costume (it's a regular garment), but the button is there. o_o Where do I look for to get rid of it? I've already checked the loc, the iteminfo, the effecthatitemtable and for possible duplicated entries in the item_dbs, but all this seems to be just fine. *Edit* Nevermind. My custom item is a garment item, apparently all garments in the game have this button. That's kind of odd, because regular garments have no sprite to preview.... oh well. I hope this thread will be useful for anyone else running into similar problems in the future. -
What file is responsible for 'Wear Costume' button?
Mistique posted a question in Client-side Support
Hi rA! I wonder, where exactly is defined which IDs have the 'wear costume' button and which don't? Not that I want to get rid of it, I like the feature but I have quite a few costumes and there are a few among them that don't have the button, whereas some other non-headgear items do have this button. Also yes, I did triple check the 'loc' in the item_db. All these items are confirmed to have the top costume loc (1024). Thanks. Help is appreciated. *Edit* Okay so update. Changing the ID made the button appear. It's interesting because I'm running a Pre-RE server with my own created set of costumes so I'm not using the ones in the db/re/item_db, though they do use some of those IDs. One of the costumes that didn't show the button was the costume with ID 20285, which originally (in RE) has a special effect. But that shouldn't matter, should it? Since my server isn't reading the RE dirs. Trying to understand what's happening here because it doesn't make much sense. O_o -
Cash Shop item payment instead of Cash Points?
Mistique replied to Mistique's question in Source Support
Cool! Thanks I will give this a go later today. Hi @anacondaq I tried it, but it's returning this error message when compiling: Not declared... but I put it in items.conf like it said in the diff. -
Cash Shop item payment instead of Cash Points?
Mistique replied to Mistique's question in Source Support
Thanks! Yes, the UI aka button cash shop, I am aware of the itemshop but would prefer the button interface. So almost not possible? I've seen servers do it though. -
Hi everyone. Not quite sure if this belongs into requests or support, but I'm trying to get the cash shop system to accept an item currency rather than regular cash points, let's say item ID 501. Does anyone know how that can be achieved? Thank you very much in advance!
-
Thanks Sader, I tried that! But I don't really want to define a fixed map name- instead have the reward function adapt whatever map is currently active as instance for the party. The function npc is working for different scripts/instances so I'm wondering if I can make it read multiple maps? i.e [email protected], [email protected], [email protected], [email protected], etc? Sorry for necro bumping but still looking for a solution for this. Still looking to get this fixed. Willing to pay if need be.
-
Hi all! I'm using a custom instance of Alanye and I'm wondering if it's possible to set the reward function to not be given to characters outside of the instance maps? Right now, party members not in the map get the same reward as party members in it. As you can imagine this is quite troublesome because they can just hoard the coins with double clients. What should I be changing? Here are the reward scripts. Thank you! Help would be much appreciated! OnFinished: instance_announce instance_id(), "Congratulation! You have completed the challenge!",bc_map,"0x00ff99"; sleep2 2000; instance_announce instance_id(), "You'll soon be warped to Valhalla",bc_map,"0x00ff99"; sleep2 2000; instance_destroy AA_INSTANCE_ID; getpartymember getcharid(1),2; copyarray [email protected], [email protected], [email protected]; detachrid; for ( set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected] +1 ) { if (attachrid([email protected][[email protected]])) { callfunc("AddPointsFixed", getcharid(3), 1 * $difficulty_level); set AARENA, AARENA + 1; warp "valkyrie",49,48; } } getpartymember getcharid(1),2; for( set [email protected], 0; [email protected] < [email protected]; set [email protected], [email protected]+1 ) if( attachrid( [email protected][[email protected]] ) && AA_INSTANCE_ID > 0){ set AA_INSTANCE_ID, -1; } } function script AddPointsFixed { if(instance_mapname(strcharinfo(3)) != instance_mapname("[email protected]") ){end;} set [email protected], getarg(0); set [email protected], getarg(1); getitem 677, 3; message rid2name([email protected]), "[ Instance ] : You've obtained 3 Coin(s) for completing instance!"; return; }
-
Thank you guys! Much appreciated!
-
Hi community. I've been going crazy over this script and decided to reach out for some assistance. The script I want is very basic (I think?)- an identifier and repair NPC combined. He would charge 3000z total for the choice they select in the menu (3000 total, not per unidentified/broken item). As you can see I've messed around with the script in hope to achieve desired result but alas. Help would be greatly appreciated. Thank you. [Header] mes "[Equip Assistant]"; mes "Hello, do you need your help with your equipment?"; menu "Identify - 3,000 Zeny",-,"Repair - 3,000 Zeny",L_Repair; set [email protected], 3000; getinventorylist; for(set [email protected],0; [email protected]<@inventorylist_count; set [email protected],[email protected]+1) { if (@inventorylist_identify[[email protected]]) continue; if (Zeny < [email protected]) { dispbottom "It costs "[email protected]+" Zeny to identify an item."; break; } set Zeny, [email protected]; delitem2 @inventorylist_id[[email protected]],1,0,0,0,0,0,0,0; getitem @inventorylist_id[[email protected]],1; setarray [email protected][0], [email protected][0]+1, [email protected][1][email protected]; } if ([email protected][0]) { message strcharinfo(0),"No items identified."; end; } specialeffect2 154; message strcharinfo(0),"Identified "[email protected][0]+" items"+(([email protected][1])?" for "[email protected][1]+" Zeny":"")+"."; end; L_Repair: if (Zeny < [email protected]) { dispbottom "It costs "[email protected]+" Zeny to repair your items."; close; } if (getbrokenid(1) == 0){ message strcharinfo(0),"No broken items detected."; end; } while (getbrokenid(1)) { repair(1); } if ([email protected]) message strcharinfo(0),"Repaired "+ [email protected] + " items for "[email protected]+" Zeny."; // How to make this part show? set Zeny, [email protected]; end; }
-
Announcer for kills made / items gathered in this script?
Mistique replied to Mistique's question in Scripting Support
I'm really eager to try that out, but it gives me this error on the map server. -
Announcer for kills made / items gathered in this script?
Mistique replied to Mistique's question in Scripting Support
Thank you very much annie. Hmm, this can't be done with something like OnPCKillEvent: if (countitem(909) > 0 && countitem(909) < 11 ){ dispbottom "You currently have [ "+ ( countitem(909) ) +" / 10 ] Jellopies."; end; I know that still goes by kill, but basically, in order to get a item you first need to kill something (if not bought from NPC or picked up from another player)... Or will that not do? Sorry, I'm kinda new at this. I'm trying to explore the possibilities hehe. xP -
Announcer for kills made / items gathered in this script?
Mistique replied to Mistique's question in Scripting Support
Ah wow you're serious? I didnt know that function was in there already, thank you very much for pointing it out annie. Is there a similar function for gathering items? Also on a related note, I also saw this upon looking for the line you mentioned: // 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 ); What is that for? It looks similar but sorta more... complicated. -
Announcer for kills made / items gathered in this script?
Mistique posted a question in Scripting Support
Hello all. I was wondering if someone was willing to give me a hand here. I'm using Emistry's mission board, now what I want to is (example, say) a mission is to kill 10 porings, that a character who accepted the mission gets a announcement that says something like "Mission Board: Killed [ 1 / 10 ] Porings.". I know it's done with bc_self and OnPCKillEvent, but I have troubles finding the right lables that determines the monsters ID and required amount to kill cause its such a massive script. This would also be amazing if it could work with the item collecting function, like "Mission Board: Gathered [ 1 / 10 ] Jelloppies. Hope this is not too much to ask, thank you for anyone willing to help Here is the script: - 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 ); // 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 "Gained some mission's 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 "Confirm remove ^0055FFMission # "[email protected][[email protected]]+"^000000?"; mes "Title: ^0055FF"[email protected]$[[email protected]]+"^000000"; mes "^777777( this cant be un-done )^000000"; if( select( "Yes, drop mission.","Confirm" ) == 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^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 ); }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; // 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 Map , Instance Map , 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] Hunted "[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" )+"^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,155,79,4 duplicate(mission_board) Mission A#1 837 prontera,154,174,4 duplicate(mission_board) Mission B#2 837 prontera,156,176,4 duplicate(mission_board) Mission C#3 837 prontera,159,179,4 duplicate(mission_board) Mission D#4 837 prontera,151,161,4 duplicate(mission_board) Mission E#5 837 prontera,154,164,4 duplicate(mission_board) Mission F#6 837 prontera,156,166,4 duplicate(mission_board) Mission G#7 837 prontera,159,169,4 duplicate(mission_board) Mission H#8 -
This function into this script. Possible?
Mistique replied to Mistique's question in Scripting Support
Yes exactly what I needed! I can't thank you enough for this!