- 0
[Request Support] Player Customized Quest Script + SQL Track [ALMOST COMPLETE]
Asked by
anticlimax18
-
Recently Browsing 0 members
No registered users viewing this page.
Asked by
anticlimax18
No registered users viewing this page.
By using this site, you agree to our Terms of Use.
Player Paid Quest Generator Script
TO DO:
OnNPCKillEvent
I Am Trying to make this Script that Uses SQL to store Quest Auto Generated.
I have scraped that Auto generate idea instead i now made it player to select combining Gather and hunting together.
Players Pay Some to Create a Quest in return for Reward if someone Completes his Quest.
Also The Quest Taker gets a Reward.
So why not use Flux Credit and add another Custom Credit for other purposed and also utilized Cash Points for Cash Shop.
My NEW Aim here is to make a Quest NPC System used by players to create and earn credits or kafra Cash points.
The Player Publish Quest.
Other Player Takes Available Quest.
The Publisher get Kafra Cash Points when his Publish Quest Completes.
The Player who took the Quest get some Custom Credits which he can use for other purposes.
Also I intend to RELEASE THIS SCRIPT AS SOON AS IT COMPLETES.
STATUS: ALMOST COMPLETE
Thanks to gmOcean till now. [For sample codes]
DataBase Table : [sUBJECTED TO CHANGE AS SCRIPT DEVELOPS.]
Table name >> "Paid_Quest"
// SQL TABLE TO BE USED.
Now What I have not done in this Script.
Yes Yes I know .. Its taking more than a week. (I am very busy got job and do this in spare time + I am not good at scripting so I need help develop it)
BELOW SCRIPT IS A COMPLETE QUEST
/************************************************************Player Paid Quest Generator Script Created By: Anticlimax18Helped by: gmOceanVersion: 1.0**************************************************************/prontera,147,168,4 script QuestMachine 877,{function mobinfo;mes "[Quest Machine]";mes "Your Reward is ^FF0000Cash Shop Points^000000";mes "^FF0000NOTE: REWARD WILL ONLY BE AWARDED ONCE THE QUEST IS COMPLETE BY SOMEONE.^000000";.@option = select("[Post Quest?]:[My Quest Status]");if (.@option == 1) goto PostQuest;goto QuestStatus;PostQuest: switch(select("New Quest : How it Works?")){ case 1: .@questcheck = query_sql("SELECT `name` From `paid_quests` where `pub_id`='"+getcharid(3)+"'",@name$); if(.@questcheck) { next; mes "[Quest Machine]"; mes "Quest Limit Reached. Max 1 Quest"; mes "Last Quest Published "+ @name$; close; } next; mes "[Follow 6 Steps]"; mes "1. Type Monster Tag ID"; mes "2. Confirm Randomize Ammount"; mes "3. View Monster Kill Details"; mes "4. Select Drop Pick for Quest"; mes "5. Set Amount for Pick"; mes "6. Proceed and Pay"; next; input .@id; //Check Exist if (getmonsterinfo(.@id,0) == "null"){ mes "[Quest Machine]"; mes "No monsters with that ID tag"; mes "Lets Try again and Read Steps please"; next; goto PostQuest;} mes mobinfo(.@id); set .@option,select("Next Monster:Close"); while ( .@option == 1){ mes mobinfo(.@id); } close;//For Safety is something goes wrong above. end; case 2: next; mes "[Quest Machine]"; mes "You can create a Paid quest by follow steps given at the time of creation."; next; mes "[Quest Machine]"; mes "Reward is 'Cash Shop Points' [Charged Credit x 2]."; mes "Eg. You where charged 200 Credit. You are rewarded 400 Cash Shop points."; next; mes "[Quest Machine]"; mes "Once someone completes your quest You will be rewarded"; next; mes "[Quest Machine]"; mes "Remember Credits are charged based upon Monster Level"; close; end; }end;QuestStatus:mes ".... Type @pqstatus to view status.";close;end;OnPCDieEvent:end; function mobinfo { .@id = getarg(0); //Loop While Selected is Randomized Kill Amount .@lvl = getmonsterinfo(.@id,1); //get level if(.@lvl < 20) set .@val,1; if(.@lvl >= 21 && .@lvl <= 30) set .@val,2; if(.@lvl >= 31 && .@lvl <= 50) set .@val,4; if(.@lvl >= 51 && .@lvl <= 60) set .@val,5; if(.@lvl > 60) set .@val,6; mes "[Quest Machine]"; mes "Monster Selected : ^ff0000"+getmonsterinfo(.@id,0)+"^000000"; mes "[Amount to Kill Amount] Min 10 | Max 30"; input .@killamt; if(.@killamt < 10 || .@killamt > 30 || .@killamt == 0 ){ mes "Out of Range. Random Amount in Range Selected."; set .@killamt,rand(10,30); } //Set Credit charged half of lvl times killamt set .@charge,(.@lvl * .@killamt)/2; next; //Display Info mes "Monster: ^0000FF"+getmonsterinfo(.@id,0)+"^000000"; mes "Level: ^00ff00"+.@lvl+"^000000"; mes "Kill Amount:["+.@killamt+"]"; mes "Amount Charged: "+.@charge+" Credits"; mes getmonsterinfo(.@id,0) +"x"+ .@killamt; if(.@lvl < 25) mes "Difficulty: ^00FF00Easy^000000"; if(.@lvl >= 25 && .@lvl <= 50) mes "Difficulty: ^0000FFMiddium^000000"; if(.@lvl >= 51 && .@lvl <= 75) mes "Difficulty: ^FF0000Hard^000000"; if(.@lvl > 75 ) mes "Difficulty: ^FF0000Insane^000000"; next; mes "[Quest Machine]"; mes "Enter Available Item Pick Up [Min 20,Max 50]:"; if (getmobdrops(getarg(0))){ .@count = $@MobDrop_count; copyarray .@item[0],$@MobDrop_item[0],.@count; copyarray .@rate[0],$@MobDrop_rate[0],.@count; for (.@i = 0; .@i < .@count; ++.@i) { //HELP HERE //Show ONLY Items Drop Rate > 50% in Mes if(.@rate[.@i] >= 5500) { mes .@item[.@i] + " (" + getitemname(.@item[.@i]) + ") " + .@rate[.@i]/100 + ((.@rate[.@i]%100 < 10) ? ".0":".") + .@rate[.@i]%100 + "%"; } } input .@item; while( !compare(.@item, getmobdrops(getarg(0)))) mes "Only Input Item Listed"; input .@item; input .@itm,20,50; if(.@itm < 10 || .@itm > 50 || .@itm == 0 ){ mes "Out of Range. Random Amount in Range Selected."; set .@itm,rand(10,50); } .@ChargedCredit = .@itm + .@charge; mes"Net Amount Charged: "+.@ChargedCredit; next; mes "[Quest Machine]"; mes "Final Step. Name You Quest."; mes "Min :5 | Max:15 - Characters."; input .@name$,5,31; next; } mes "[Quest Machine]"; mes "Quest Name:^00FF00"+.@name$+"^000000"; mes "Total Credit Charged: "+ .@ChargedCredit; if (select("Proceed?:CreateAgain") == 2) goto PostQuest; //Query_SQL (Get credit Balance) query_sql("SELECT balance FROM `cp_credits` WHERE `account_id`='"+getcharid(3)+"'",.@CreditAmount); if(!.@CreditAmount) set .@CreditAmount,0; if (.@CreditAmount < .@ChargedCredit ) { mes "Sorry You dont have enough credit"; mes"Credit Balance: "+.@CreditAmount; close;} //query_sql (Update) query_sql("UPDATE `cp_credits` SET `balance` VALUE `balance`='balance-"+.@ChargeCredit+"'"); query_sql("SELECT balance FROM `cp_credits` WHERE `account_id`='"+getcharid(3)+"'",.@NewAmount); mes "Credits Charged. Credit Blance Remaining: "+.@NewAmount; .@reward = .@CreditAmount/2; //Reward is 50% Cash Credit that of Charged Credit. query_sql("INSERT INTO `paid_quests` (`name`,`pub_id`,`TrackID`,`mob_id`,`item_id`,`tar_kill`,`tar_collect`,`reward`,`time`) VALUE('"+.@name$+"','"+getcharid(3)+"','0','"+.@id+"','"+.@item+"','"+.@killamt+"','"+.@itm+"','"+.@reward+"','"+.today+"')"); mes "Quest Added."; mes "You Can Check status with @pqstatus"; mes "Thank you for Your Time."; close; }//End FunctionOnInit:OnClock0000: .today = gettimestr("%Y-%m/%d %H:%M:%S",21);//OnEvents Are Set in other Files for Customize purposes. }//Additional Script for Status Display.- script atcmd -1,{OnInit:bindatcmd "pqstatus",strnpcinfo(3)+"::OnPQStatus";OnPQStatus:mes "[Paid Quest Status]";.@progress = query_sql("SELECT `name`,`trackid`,`time` FROM `paid_quests` WHERE pub_id='"+getcharid(3)+"'",.@quest$,.@status,.@date);if (!.@progress) { mes "No Quest Alloted. Only use if you have posted a Quest."; close;}mes "Quest Name: ^00FF00"+.@quest$+"^000000";mes "Status:"+((.@status)?"^0000ffIn Progress^000000":"^ff0000Waiting to be taken^000000");mes "Post Date:"+.@date;close;end;}ANY ONE WHO PARTICIPATE IN HELPING WILL GET ITS NAME IN THE CREDITS.
Edited by anticlimax18Share this post
Link to post
Share on other sites