Jump to content

anticlimax18

Members
  • Content Count

    17
  • Joined

  • Last visited


Reputation Activity

  1. Upvote
    anticlimax18 reacted to GmOcean in [Request Support] Player Customized Quest Script + SQL Track [ALMOST COMPLETE]   
    Well, I wrote a variation of your script, but it's not 100% complete, nor am I fully positive it's working 100%, but script_checker says there is no errors in the syntax. Perhaps, you can use it for a comparison to your code, and find the results you need:
    prontera,164,167,0 script Quest Master 857,{mes ( .@npc$ = "[^FF0000 Quest Master ^000000" );mes "[^00FF00 Generate Requirement ^000000]";mes ""+ getitemname(.currency[0]) +" x "+ .currency[1] +"";mes "[^0000FF Taking Requirement ^000000]";mes ""+ getitemname(.currency[2]) +" x "+ .currency[3] +"";next;mes .@npc$;switch( select( "[Turn in all quests]", "[Obtain Quest]", "[Abandon Quest]", "[Generate Quests]"+ ( (getgmlevel() >= 99)?":[Generate Random Quests]" : "" )+"" ) ){ case 1: for( .@i = 0; .@i < getarraysize( @quests$ ); .@i++ ){ explode( .@array$, @quests$[.@i], ":" ); switch( atoi(.@array$[5]) ){ case 1: if( .@array$[4] == .@array$[3] ){ .@quests[.@a] = atoi( .@array$[6] ); .@a++; } break; case 2: case 3: if( countitem( atoi(.@array$[2]) ) == atoi(.@array$[3]) ){ .@quests[.@a] = atoi( .@array$[6] ); .@a++; } break; } } if( !.@quests[0] ){ mes "You don't have any completed quests."; close; } getitem .currency[0], (.currency[1] * getarraysize(.@quests)); for( .@i = 0; .@i < getarraysize( @quests$ ); .@i++ ){ explode( .@array$, @quests[.@i], ":" ); for( .@j = 0; .@j < getarraysize( .@quests ); .@j++ ){ if( .@quests[.@j] == .@array$[6] ){ @quests[.@i] = ""; .@quests$ = .@quests$ + ""+ .@array$[6] +":"; } } } callsub iRedeem, .@quests$; // Updates quests to have a reward so posters can redeem it. mes "All quests have been redeemed."; mes "Come back again, and complete some more."; close; case 2: if( max_active && ( getarraysize(@quests$) >= .max_active ) ){ mes "You can not actively pursue any more quests at the moment."; mes "You need to either complete your current quests or abandoned them."; close; } mes "Only a maximum of "+ .select_limit +" available quests will be listed from a category at a time."; mes "Select a category."; next; mes .@npc$; .@select = select( "[Hunting] - [Random Difficulty]", "[Item Gather] - [Random Difficulty]", "[Cooking] - [Hard Difficulty]"); .@count = query_sql("SELECT * FROM `Paid_Quest` WHERE `TrackID` = '0' AND `type` = '"+ .@select +"'", .@quest_id, .@name$, .@pub_id, .@track_id, .@mob_id, .@itme_id, .@tar_amt, .@type, .@time); if( !.@count ){ mes "There are no quests of this type available at this time."; close; } iQSelectLoop: if( .@count < ( .select_limit ) ){ .@select2 = ( .@count + 1 ); } else { .@select2 = ( .select_limit + 1 ); } .@select = .@select2; while( .@select == .@select2 ){ .@quest_menu$ = ""; .@i = 1; while( .@i < .@select2 ){ .@a = rand( getarraysize(.@name$) ); if( !compare( .@quest_menu$, .@name$[.@a] ) ){ .@quest_menu$ = .@quest_menu$ + .@name$[.@a] +":"; .@quest_select[.@i] = .@a; .@i++; } } .@quest_menu$ = .@quest_menu$ + "[^0000FF More Quests ^000000]"; .@select = select( .@quest_menu$ ); } .@a = .@quest_select[.@select]; mes .@name$[.@a]; switch( .@type[0] ){ case 1: mes "Objective: "+ getmonsterinfo( .@mob_id[.@a], 0 ) +""; mes "Kill amount: "+ .@tar_amt[.@a] +""; break; case 2: case 3: mes "Objective: "+ getitemname( .@item_id[.@a] ) +""; mes ""+ ( (.@type[0] == 2)? "Collect Amount" : "Cook Amount" ) +": "+ .@tar_amt[.@a] +""; break; } mes "----------------------------------"; mes "Do you accept?"; next; if( select( "Yes, I accept", "No, let me choose another" ) == 2 ){ callsub iQSelectLoop; end; } @quests$[getarraysize(@quests$)] = .@name$[.@a] +":"+ .@mob_id[.@a] +":"+ .@item_id[.@a] +":"+ .@tar_amt[.@a] +":"+ 0 +":"+ .@type[0] +":"+ .@quest_id[.@a] +""; query_sql("UPDATE `Paid_Quest` SET(`TrackID`) VALUES('"+ getcharid(0) +"') WHERE `id` = '"+ .@quest_id[.@a] +"'"); mes .@npc$; mes "Quest Accepted."; mes "All quests will be abandoned upon logging out."; close; case 3: mes "Did you want to abandon all your quests, or a specific one?"; next; mes .@npc$; if( select( "One quest", "All quests" ) == 2 ){ @quests$ = ""; mes "All quests have been abandoned."; close; } for( .@i = 0; .@i < getarraysize(@quests$); .@i++ ){ explode( .@array$, @quests$[.@i], ":" ); .@quest_menu$ = .@quest_menu$ + .@array$[0] +":"; } mes "Which quest did you want to abandon?"; next; .@select = select( .@quest_menu$ ); explode( .@array$, @quests$[( .@select - 1 )], ":" ); mes .@array$[0]; switch( .@array$[5] ){ case 1: mes "Objective: "+ getmonsterinfo( .@array$[1], 0 ) +""; mes "Progress: "+ .@array$[4] +" / "+ .@array$[3] +""; break; case 2: case 3: mes "Objective: "+ getitemname( .@array$[2] ) +""; mes "Progress: "+ countitem( .@array$[2] ) +" / "+ .@array$[3] +""; break; } mes "----------------------------------"; mes "Are you sure you want to abandon this quest?"; next; if( select( "Yes, abandon the quest.", "No, I've changed my mind." ) == 2 ){ close; } @quests$[( .@select - 1)] = ""; mes "Quest has been abandoned."; close; case 4: // Only Item Collection quests are available to create as of now. mes "What item did you want to post for a quest?"; input .@item; if( !getitemname( .@item ) == "null" ){ mes "^^FF0000 INVALID ITEM"; close; } mes "How many did you want to request?"; mes "Minimum: 1","Maximum: 1,000"; input .@amt,1,1000; query_sql("INSERT INTO `Paid_Quests` (`name`,`pub_id`,`item_id`,`tar_amt`,`type`,`time`) VALUES('"+ escape_sql("Collection: "+ getitemname(.@item) +"") +"','"+ getcharid(0) +"','"+ .@item +"','"+ .@amt +"','2','"+ gettimetick(2) +"')"); next; mes "Quest, successfully submitted."; close; case 5: // GM only quest generator. end;}iRedeem:explode( .@array$, getarg(0), ":" );for( .@x = 0; .@x < getarraysize( .@array$ ); .@x++ ){ query_sql("UPDATE `Paid_Quests` SET(`reward`) VALUES('1') WHERE `id` = '"+ atoi(.@array$[.@x]) +"'");}return;end;OnInit:// [0] = Item Required to post a quest. | [1] = Amount needed.// [2] = Item Required to accept a quest. | [3] = Amount needed.setarray .currency[0], 501, 5, 502, 1;// Amount of quests to post at a time.// Default: 3.select_limit = 3;// [0] = Start of Food item IDs// [1] = End of Food item IDs.setarray .cook_id[0], 12040, 12100;// Max amount of quests each player can actively pursue at a time.// Default: 3.max_active = 3;end;}// SQL TABLE TO BE USED./*CREATE TABLE `master_main`.`paid_quests` ( `id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `pub_id` INT(11) NOT NULL, `TrackID` INT(11) NOT NULL DEFAULT 0, `mob_id` INT(11) NOT NULL DEFAULT 0, `item_id` INT(11) NOT NULL DEFAULT 0, `tar_amt` INT(11) NOT NULL DEFAULT 0, `type` INT(11) NOT NULL DEFAULT 0, `time` BIGINT NOT NULL DEFAULT 0, PRIMARY KEY (`id`), UNIQUE INDEX `id_UNIQUE` (`id` ASC));*/  
    *Note - This hasn't been tested. Reason being, I do not want to setup a sql table, add quests and the such to do the testing for this. You can post back errors, you find and I'll will provide support for it, but right now I'm not going to alter my sql schemas*.
  2. Upvote
    anticlimax18 reacted to GmOcean in [Request Support] Player Customized Quest Script + SQL Track [ALMOST COMPLETE]   
    Perhaps something like this:
    - script sql_quest_generator -1,{OnHuntingCreate:freeloop(1); // Freeloop to prevent infinite loop error.while( .@hunting != .hunting_generate ){ // Loop through the below until a total of (.hunting_generate) amount of quests have been created. .@a = rand(.min_hunting_objective, .max_hunting_ojbective); // Select a random amount of objectives for this quest. .@name$ = "Hunting:"; // Start of the quest name. // Loop the below until the selected amount of objectives have been added to the proper variables. while( .@b != .@a ){ .@i = rand(1001,3000); // Selecting a random mob_id # from 1001 (Scorpion) -> 3000 ( Just going beyond what exists to add support for custom mobs ). if( !compare( .blacklist$, ""+ getmonsterinfo( .@i, 0 ) +"" ) ){ // Compares monster ID number to see if it is blacklisted or not. .@mob_objectives[.@b] = .@i; // Adds the monster as an objective. .@mob_obj_amount[.@b] = rand(.min_hunting_amount, .max_hunting_amount); // Adds a random amount to be killed to complete that objective. .@name$ = .@name$ + getmonsterinfo( .@i, 0 ); // Adds the monster's name as part of the quest name. .@b++; } } // We create an entry in our custom quest_database using just the Quest name for now. // This will serve as a pointer when adding in all the objectives later, since the amounts were dynamically chosen and not set in stone. query_sql("INSERT INTO quest_database `quest_name` = '"+ .@name$ +"'"); // Loop through this until ALL objectives & the amount needed to complete it, have been added to the quest we listed above. while( .@c < getarraysize( .@mob_objectives ) ){ // Adding in each objective and it's amount to the quest we just created above. query_sql("Update quest_database SET( `obj"+ .@c +"`, `amt"+ .@c +"'`) VALUES( '"+.@mob_objectives[.@c]+"', '"+.@mob_obj_amount[.@c]+"') WHERE `quest_name`='"+ .@name$ +"'"); .@c++; } // Set this variable +1 to say we have completed creating a quest. And to continue looping if not all of them have been created. .@hunting++;}// Freeloop(0) to let server know we are done looping and to stop trying to prevent infinite loops.freeloop(0);end;// This is where the settings go to configure the above to do what you want.OnInit:.hunting_generate = 3; // How many hunting quests to create and add to sql.// Minimum and Maximum amount of different monsters to be used as an objective..min_hunting_objective = 1;.max_hunting_objective = 5; // Note - This can not be higher than the number of objectives listed in your sql table. So if your sql table only supports 3, this can be no higher than 3.// Minimum and Maximum amount to be killed for each objective..min_hunting_amount = 5;.max_hunting_amount = 20;// Bonus, a custom command that when used, will attempt to create a (.hunting_generate) more quests and add them to the database.bindatcmd "huntgen", strnpcinfo(3)+"::OnHuntingCreate";end;}  
    It's untested, but if it works, it should generate 3 hunting quests, with random amount of 1-5 different monsters to hunt, ranging from 5-20 of each to kill. And place them into a sql database.
  3. Upvote
    anticlimax18 got a reaction from nana in [Lua Files] 2014 clients only.   
    Anticlimax18's Lua 2014
    Hi guys,

    If you have problem with 2014 Clients lua files.
    Then this is the one which do not give Errors.

    Let me know any issues if you face using them.

    There are lub files which I am using from latest 2014-10 iRO Client

    Somehow the old files where too outdated so I decided to use them and they worked like a charm.
    Lua+System2014.7z
  4. Upvote
    anticlimax18 reacted to Mystery in CLOSED THREAD   
    I guess it's time for me to step in. 
     
    First off, the fact that you created 3 support topics in total regarding the same thing is beyond me. Please don't duplicate your topics. 1 is more than enough.
     
    If people want to charge you to complete the script, they can. Just because we're a free community, doesn't mean individuals need to do things for free. If they want to do things for free, the more the merrier. But you can't expect everyone to do things for free. Welcome to the internet world; or the world in general.
     
    Please keep this topic on topic or it will be closed.
  5. Upvote
    anticlimax18 reacted to evilpuncker in CLOSED THREAD   
    dude, seriously, if you are in ragnarok just for money, at least try to spend some of your own hiring a scripter instead of begging for help lol
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.