Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===============================================//
- // This script is made by Plug and Play //
- // Facebook http://facebook.com/plugandplayPH //
- // Script Title : Guild Storage NPC //
- // Version : 1.0 //
- // DO NOT REMOVE THE SCRIPT OWNER //
- //---------------- FEATURES ---------------------//
- // Bindcommand : @gstorage/@guildstorage //
- // .MemberUsed = Setting for Player and Leader //
- // Verification Question and Answer //
- // Have 3 Attempts for Guild Password //
- //===============================================//
- prontera,100,65,4 script Guild Manager 4_M_HUGRANFA,{
- OnGuildStorage: // Do not remove this
- // NPC Name
- set .@gnpcname$,"[ ^CC00FF Guild Manager ^000000]";
- // Who can use Guild Storage
- // 0 = Guild Leader Only
- // 1 = All The Members
- set .MemberUsed,1;
- // Verification Question
- // You can ONLY set 4 Verification Question
- // Less than or Exceeding by 4 make the script Error
- setarray .VerificationQuestion$[0],"Ragnarok Pet Name","Coolest Ragnarok Skill","Hangout Place in Ragnarok","Cutest Ragnarok Headgear";
- //---- SQL ----//
- set .check_gname,query_sql(" SELECT `Guild_ID` , `Password` , `Question` , `Answer` FROM `pnp_gstorage` WHERE `Guild_ID`= '"+getcharid(2)+"'",.@GuildID,.@GuildPassword$,.@GuildQuestion$,.@GuildAnswer$ );
- //------------//
- if( !getcharid(2) ) {
- mes .@gnpcname$;
- mes "Sorry, You dont have a Guild.";
- close;
- }
- mes .@gnpcname$;
- mes "I am the Manager of All the Registered Guilds.";
- mes "You can use Guild Storage with Password.";
- next;
- if( !.check_gname && getguildmasterid( getcharid(2) ) == getcharid(0)){
- goto Register_Guild;
- }
- if( .MemberUsed >= 1 ){
- if ( .check_gname && getguildmasterid( getcharid(2) ) != getcharid(0) ) goto Member_Guild_Storage;
- else if ( .check_gname && getguildmasterid( getcharid(2) ) == getcharid(0) ) goto Leader_Guild_Storage;
- else if ( !.check_gname ) mes .@gnpcname$; mes "Guild is not Registered."; close;
- }
- if ( .MemberUsed <= 0 ){
- if ( getguildmasterid( getcharid(2) ) == getcharid(0) ){
- goto Leader_Guild_Storage;
- }
- else if ( getguildmasterid( getcharid(2) ) != getcharid(0) ){
- mes .@gnpcname$;
- mes "Only the Guild Leader can access the ^00FF00Guild Storage^000000.";
- close;
- }
- }
- Register_Guild:
- mes .@gnpcname$;
- mes "You guild is not yet register.";
- mes "You must follow and read the rules.";
- next;
- mes .@gnpcname$;
- mes "1. We are not responsible to any lose items.";
- mes "2. Do not disclosed your Guild Storage Info.";
- mes "3. You must filled up the following Info needed.";
- mes "3. Just Enjoy Using our Service.";
- next;
- mes .@gnpcname$;
- mes "Set your ^CC0000Guild Password^000000.";
- input @Guild_Password$;
- next;
- mes .@gnpcname$;
- mes "Re-type your Guild Password.";
- input @Retype_Guild_Password$;
- next;
- if( @Guild_Password$ != @Retype_Guild_Password$ ){
- mes .@gnpcname$;
- mes "^FF0000Error : ^000000 Password doesn't Match.";
- next;
- switch(select("Register Guild:Cancel Action")){
- case 1:
- goto Register_Guild;
- break;
- case 2:
- goto Exit_Option;
- break;
- } // end of switch
- } // end of recognizing retype password
- if( @Guild_Password$ == @Retype_Guild_Password$ ){
- mes .@gnpcname$;
- mes "Choose your Guild Question.";
- mes "You can use this in changing your Guild Storage Password.";
- next;
- menu .VerificationQuestion$[0],VQuestion_01,.VerificationQuestion$[1],VQuestion_02,.VerificationQuestion$[2],VQuestion_03,.VerificationQuestion$[3],VQuestion_04;
- VQuestion_01:
- mes .@gnpcname$;
- mes .VerificationQuestion$[0];
- mes "Put your Answer.";
- input @Guild_Answer$;
- next;
- menu "Submit Guild Registration",sgr_q1,"Cancel Action",sgr_c1;
- sgr_q1:
- mes .@gnpcname$;
- mes "^00FF00"+strcharinfo(2)+"^000000 has been registered.";
- query_sql( "INSERT INTO `pnp_gstorage` ( `Guild_ID` , `Password` , `Question` , `Answer` ) VALUES ( '"+getcharid(2)+"' , '"+@Guild_Password$+"' , '"+.VerificationQuestion$[0]+"' , '"+@Guild_Answer$+"' ) ");
- close;
- end; // end of submit_guild_registration
- sgr_c1:
- goto Exit_Option;
- end; // end of sgr_cancel
- VQuestion_02:
- mes .@gnpcname$;
- mes .VerificationQuestion$[1];
- mes "Put your Answer.";
- input @Guild_Answer$;
- next;
- menu "Submit Guild Registration",sgr_q2,"Cancel Action",sgr_c2;
- sgr_q2:
- mes .@gnpcname$;
- mes "^00FF00"+strcharinfo(2)+"^000000 has been registered.";
- query_sql( "INSERT INTO `pnp_gstorage` ( `Guild_ID` , `Password` , `Question` , `Answer` ) VALUES ( '"+getcharid(2)+"' , '"+@Guild_Password$+"' , '"+.VerificationQuestion$[1]+"' , '"+@Guild_Answer$+"' ) ");
- close;
- end; // end of submit_guild_registration
- sgr_c2:
- goto Exit_Option;
- end; // end of sgr_cancel
- VQuestion_03:
- mes .@gnpcname$;
- mes .VerificationQuestion$[2];
- mes "Put your Answer.";
- input @Guild_Answer$;
- next;
- menu "Submit Guild Registration",sgr_q3,"Cancel Action",sgr_c3;
- sgr_q3:
- mes .@gnpcname$;
- mes "^00FF00"+strcharinfo(2)+"^000000 has been registered.";
- query_sql( "INSERT INTO `pnp_gstorage` ( `Guild_ID` , `Password` , `Question` , `Answer` ) VALUES ( '"+getcharid(2)+"' , '"+@Guild_Password$+"' , '"+.VerificationQuestion$[2]+"' , '"+@Guild_Answer$+"' ) ");
- close;
- end; // end of submit_guild_registration
- sgr_c3:
- goto Exit_Option;
- end; // end of sgr_cancel
- VQuestion_04:
- mes .@gnpcname$;
- mes .VerificationQuestion$[0];
- mes "Put your Answer.";
- input @Guild_Answer$;
- next;
- menu "Submit Guild Registration",sgr_q4,"Cancel Action",sgr_c4;
- sgr_q4:
- mes .@gnpcname$;
- mes "^00FF00"+strcharinfo(2)+"^000000 has been registered.";
- query_sql( "INSERT INTO `pnp_gstorage` ( `Guild_ID` , `Password` , `Question` , `Answer` ) VALUES ( '"+getcharid(2)+"' , '"+@Guild_Password$+"' , '"+.VerificationQuestion$[3]+"' , '"+@Guild_Answer$+"' ) ");
- close;
- end; // end of submit_guild_registration
- sgr_c4:
- goto Exit_Option;
- end; // end of sgr_cancel
- } // end of if retype password is match
- end; // end of Register_Guild
- Member_Guild_Storage:
- mes .@gnpcname$;
- mes "Put your Guild Storage Password";
- mes "You only have 3 Attempts.";
- mes "Or else I will broadcast your name for hacking the guild storage.";
- input @First_Attempt_Password$;
- next;
- if( .@GuildPassword$ != @First_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "^FF0000Error^000000 : Incorrect Password.";
- mes "This is your ^FF00CC2nd Attempt^000000";
- input @Second_Attempt_Password$;
- next;
- if ( .@GuildPassword$ != @Second_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "^FF0000Error^000000 : Incorrect Password.";
- mes "This is your ^FF00CCLast Attempt^000000";
- input @Third_Attempt_Password$;
- next;
- if ( .@GuildPassword$ != @Third_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "You trying to hack this guild.";
- mes "You are now in shame.";
- announce "[ Guild Manager ] : "+strcharinfo(0)+" is trying to hack the guild storage of "+strcharinfo(2)+" Guild.",0,0xCCCCFF;
- close;
- }
- else if ( .@GuildPassword$ == @Third_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "Get your Guild Stuff now!";
- close2;
- guildopenstorage();
- end;
- }
- }
- else if ( .@GuildPassword$ == @Second_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "Get your Guild Stuff now!";
- close2;
- guildopenstorage();
- end;
- }
- }
- else if ( .@GuildPassword$ == @First_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "Get your Guild Stuff now!";
- close2;
- guildopenstorage();
- end;
- }
- end; // end of Member_Guild_Storage
- Leader_Guild_Storage:
- mes .@gnpcname$;
- mes "Good Day "+strcharinfo(0);
- mes "Guild : "+strcharinfo(2);
- mes "Choose an option.";
- next;
- switch(select("Open Guild Storage:Change Password:Cancel Action")){
- case 1:
- mes .@gnpcname$;
- mes "Put your Guild Storage Password";
- mes "You only have 3 Attempts.";
- mes "Or else I will broadcast your name for hacking the guild storage.";
- input @First_Attempt_Password$;
- next;
- if( .@GuildPassword$ != @First_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "^FF0000Error^000000 : Incorrect Password.";
- mes "This is your ^FF00CC2nd Attempt^000000";
- input @Second_Attempt_Password$;
- next;
- if ( .@GuildPassword$ != @Second_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "^FF0000Error^000000 : Incorrect Password.";
- mes "This is your ^FF00CCLast Attempt^000000";
- input @Third_Attempt_Password$;
- next;
- if ( .@GuildPassword$ != @Third_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "You trying to hack this guild.";
- mes "You are now in shame.";
- announce "[ Guild Manager ] : "+strcharinfo(0)+" is trying to hack the guild storage of "+strcharinfo(2)+" Guild.",0,0xCCCCFF;
- close;
- }
- else if ( .@GuildPassword$ == @Third_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "Get your Guild Stuff now!";
- close2;
- guildopenstorage();
- end;
- }
- }
- else if ( .@GuildPassword$ == @Second_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "Get your Guild Stuff now!";
- close2;
- guildopenstorage();
- end;
- }
- }
- else if ( .@GuildPassword$ == @First_Attempt_Password$ ){
- mes .@gnpcname$;
- mes "Get your Guild Stuff now!";
- close2;
- guildopenstorage();
- end;
- }
- break;
- case 2:
- mes .@gnpcname$;
- mes "Before you can change the ^00CC00Guild Password^000000, you must fill all the Info needed.";
- mes "This is for the security purposes.";
- next;
- mes .@gnpcname$;
- mes "Guild Question :";
- mes .@GuildQuestion$;
- input @Guild_Verification_Answer$;
- next;
- if( @Guild_Verification_Answer$ == .@GuildAnswer$ ){
- mes .@gnpcname$;
- mes "Put your ^CC0000Old Password^000000";
- input @Old_Guild_Password$;
- next;
- if( @Old_Guild_Password$ == .@GuildPassword$ ){
- mes .@gnpcname$;
- mes "Put your ^006633New Guild Password^000000";
- input @New_Guild_Password$;
- next;
- if( .@GuildPassword$ == @New_Guild_Password$ ){
- mes .@gnpcname$;
- mes "^FF0000Error^000000 : New Password is your Old Password";
- next;
- goto Leader_Guild_Storage;
- }
- if( .@GuildPassword$ != @New_Guild_Password$){
- mes .@gnpcname$;
- mes "Re-Type your ^006633New Guild Password^000000";
- input @Retype_New_Guild_Password$;
- next;
- if ( @New_Guild_Password$ == @Retype_New_Guild_Password$ ){
- mes .@gnpcname$;
- mes "You successfully change your ^CC0000Guild Password^000000";
- query_sql("UPDATE `pnp_gstorage` SET `Password`= '"+@New_Guild_Password$+"' WHERE `Guild_ID`='"+getcharid(2)+"'");
- close;
- }
- else if ( @New_Guild_Password$ != @Retype_New_Guild_Password$ ){
- mes .@gnpcname$;
- mes "^FF0000Error^000000 : New Password and Re-Type New Password doesn't match";
- next;
- goto Leader_Guild_Storage;
- }
- }
- }
- else if( @Old_Guild_Password$ != .@GuildPassword$ ){
- mes .@gnpcname$;
- mes "^FF0000Error^000000 : Incorrect Password";
- next;
- goto Leader_Guild_Storage;
- }
- }
- else if( @Guild_Verification_Answer$ != .@GuildAnswer$ ){
- mes .@gnpcname$;
- mes "^FF0000Error^000000 : Incorrect Guild Verification Answer";
- next;
- goto Leader_Guild_Storage;
- }
- close;
- break;
- case 3:
- goto Exit_Option;
- break;
- } // end of switch
- end; // end of Leader_Guild_Storage
- Exit_Option:
- mes .@gnpcname$;
- mes "Come back later.";
- close;
- end; // end of Exit_Option
- OnInit:
- bindatcmd "gstorage",strnpcinfo(3)+"::OnGStorage";
- bindatcmd "guildstorage",strnpcinfo(3)+"::OnGStorage";
- end;
- OnGStorage:
- goto OnGuildStorage;
- end;
- } // end of header
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement