Назад

Помогите исправить нпц

Автор: Kill Spirit: Дата: 05.22.2010

Правдо говоря я только на 46% научился писать нпц...

Вот и попрошу исправить вот этого:

Ошибка:

Missing 2 right curlys at file 'npc/def.txt', line '229'.



Если поставить 2 } , то выскакивает вот такая ошибка:

Ошибка:
[Error]:  Loading NPC file: npc/def.txt
script error on npc/def.txt line 177
expect ';' or '{' at function syntax
172 : if (@Attempt>=3){atcommand "@ban "+@BanTime+"mn "+strcharinfo(0)+""
; end;}
173 : next; goto InputSecurityPass;}
174 : close;
175 : end;
176 : }
* 177 : function script' 'Set_AcctSecure {
178 : set .@npcName$,"[^0000FF Security Personel ^000000]";
179 : menu "Set up a Security Password",iSP,"Information on System",iSI,"Canc
el",cancel;
180 : iSP:
181 : next;
182 : mes .@npcName$;


Сам нпц:

prontera,150,150,0	script	Midgard Security	413,{
set .@npcName$,"[^0000FF Security Personel ^000000]";
mes .@npcName$;
mes "Welcome! I am a member of Midgard's Security.";
mes "As such, it is my job to ensure account safety of our players.";
mes "That is of course if they wish to use our service.";
next;
mes "So, what would you like to do?";
goto LacctCheck;
LacctCheck:
menu "Enable / Disable Security",iAD,"Change Password",iCP,"Change RecoveryPhrase",iRP,"View Password Attempts",iVP,"Cancel",cancel;
iAD:
if (#SecurityPass$!="NoPopUp"){set #SecurityPass$,"NoPopUp"; mes "Security is now turned OFF."; close;}
if (#SecurityPass$=="NoPopUp")
{next;
mes "Input a new Password";
input .@CSpassword$;
if (.@CSpassword$==#RecoveryPhrase$){next; mes "Your Password cannot be the same as your Recovery-Phrase. Please try agian."; goto iAD;}
set @CSpassword$,.@CSpassword$;
next;
mes "Input it again for confirmation.";
input .@CSpassword$;
if (.@CSpassword$!=@CSpassword$){mes "That is incorrect. Try again."; close;}
set #SecurityPass$,@CSpassword$;
mes "Security is now turned ON.";
next;
goto iRecoveryPhrase;
iRecoveryPhrase:
mes "... ... ... ...";
mes "Now then, please input a recovery phrase";
mes "This phrase will be used to recover your password, in case you forget it.";
input .@RecoveryPhrase$;
if (.@RecoveryPhrase$==#SecurityPass$){next; mes "Your Recovery-Phrase cannot be the same as your Password. Please try again."; next; goto iRecoveryPhrase;}
set @RecoveryPhrase$,.@RecoveryPhrase$;
next;
mes "Input it again for confirmation.";
input .@RecoveryPhrase$;
if (@RecoveryPhrase$!=.@RecoveryPhrase$){mes "Those phrases don't match. Please try again."; close;}
set #RecoveryPhrase$,@RecoveryPhrase$;
mes "Please write this phrase down. It will be used to recover your password should you ever forget it.";
next;
mes "Once again, here it is:";
mes "^0000FF"+#RecoveryPhrase$+"^000000";
mes "WRITE IT DOWN ! ";
goto iSecurityPhrase;
iSecurityPhrase:
next;
mes "Now Input a Security Phrase. This is slightly different, from the recovery phrase.";
mes "It will be used, to notify the GM that you have forgotten your password and recovery phrase.";
input .@SecurityPhrase$;
if (.@SecurityPhrase$==#RecoveryPhrase$ || .@SecurityPhrase$==#SecurityPass$){next; mes "Your Security Phrase cannot be the same as your Password OR Recovery Phrase"; goto iSecurityPhrase;}
set #SecurityPhrase,.@SecurityPhrase;
mes "Make sure to keep this phrase safe, and do not share it with others.";
close;}
end;
iCP:
next;
mes .@npcName$;
if (#SecurityPass$=="NoPopUp"){mes "You don't have a password set."; mes "^0000FFPlease go set one by enabling the security.^000000"; close;}
mes "Very well then. Please Enter your Current Security Password.";
input .@CSpassword$;
if (.@CSpassword$!=#SecurityPass$){next; mes "That is incorrect. Try again."; close;}
next;
mes "Now then. Please Enter your new Security Password.";
input .@NSpassword$;
if (.@NSpassword$==#RecoveryPhrase$){next; mes "Your Password cannot be the same as your Recovery-Phrase. Please try agian."; goto iCP;}
set @NSpassword$,.@NSpassword$;
next;
mes "Please Enter it again for confirmation.";
input .@CNSpassword$;
if (@NSpassword$!=.@CNSpassword$){next; mes "That is incorrect. Try again."; close;}
set #SecurityPass$,.@CNSpassword$;
next;
mes "Your password was changed successfully. Come again.";
close;
iRP:
next;
mes .@npcName$;
if (#RecoveryPhrase$=="")
{mes "You don't have a Recovery Phrase set.";
mes "Please set one by enabling the Security.";
close;}
mes "Very well then. Please Enter your Current Recovery Phrase.";
input .@RecovPhrase$;
if (.@RecovPhrase$!=#RecoveryPhrase$){next; mes "That is incorrect. Try again."; close;}
next;
mes "Now then. Please Enter your new Recovery Phrase.";
input .@NRP$;
if (.@NRP$==#SecurityPass$){next; mes "Your Recovery-Phrase cannot be the same as your Password. Please try again."; goto iRP;}
set @NRP$,.@NRP$;
next;
mes "Please enter it again for confirmation.";
input .@NRP$;
if (@NRP$!=.@NRP$){next; mes "Those phrases don't match. Try again."; close;}
set #RecoveryPhrase$,@NRP$;
next;
mes "Your Recovery Phrase was changed successfully.";
mes "Please write it down. It will be used in case you forget your password.";
next;
mes "Here it is:";
mes "^0000FF"+#RecoveryPhrase$+"^000000";
mes "WRITE IT DOWN !";
close;
iVP:
next;
mes .@npcName$;
mes "Alright. Here you go.";
mes "There have been in total: ^0000FF"+#SecurityAttempt+"^000000 password attempts.";
close;
cancel:
close;
OnPCLoginEvent:
set .@npcName$,"[^0000FF Security Personel ^000000]";
set @BanTime,5;
if (#SecurityPass$=="")
{mes .@npcName$;
mes "This server has a unique system which allows you to have a SECOND password.";
mes "This is of course optional. Would you like to use it?";
menu "Yes, set it up.",iYes,"No, and please stop showing up.",iNo;
iYes:
next;
callfunc "Set_AcctSecure";
iNo:
set #SecurityPass$,"NoPopUp";
percentheal 100,100;
mes "Alright then. Just remember, if you're interested, talk to the Security Personel in prontera.";
close;
end;}
if (#SecurityPass$=="NoPopUp"){set @SecurityPass,1; end;}
if (#SecurityPass$!="NoPopUp" && #SecurityPass$==#SecurityPass$)
{sc_start 112,999999999,100;
sc_start 1,999999999,100;
sc_start 8,999999999,100;
goto InputSecurityPass;}
end;
OnPCLoadMapEvent:
getmapxy(@Map$,@X,@Y,0);
if (@Map$=="prontera" || @Map$!="prontera"){
if (@SecurityPass==0 && #SecurityPass$!="NoPopUp" && #SecurityPass$==#SecurityPass$)
{goto InputSecurityPass;}
if (@SecurityPass==0 && #SecurityPass$=="NoPopUp"){set @SecurityPass,1; end;}
if (@SecurityPass==1){end;}
end;
}
InputSecurityPass:
mes "This account is protected by Midgard Security Personel.";
mes "Input your password to continue playing.";
mes "OR";
mes "Input your Recovery-Phrase in case you lost your password.";
mes "OR";
mes "Input your Security-Phrase in the case you lost both of the above.";
input .@spass$;
if (#RecoveryPhrase$==.@spass$)
{next;
mes "Here is your password, don't lose it again.";
mes "^0000FF"+#SecurityPass$+"^000000";
next; goto InputSecurityPass;}
if (#SecurityPass$==.@spass$)
{mes "That is correct"; set @SecurityPass,1; sc_end 1; sc_end 112; sc_end 8;
percentheal 100,100; close; end;}
if (#SecurityPhrase$==.@spass$)
{for(set .@i,0; .@i {if (!$LP_ACCT_ID[.@i])
{setarray $LP_ACCT_ID[.@i],getcharid(3,strcharinfo(0));
setarray $LP_USER_NM[.@i],strcharinfo(0);
next;
mes "Your name has been registered on the list of Lost-Passwords.";
mes "Your information will be reset, 1 hour AFTER a GM checks validates you.";
atcommand "@kick "+strcharinfo(0)+""; close;}
if (#SecurityPass$!=.@spass$ && #RecoveryPhrase$!=.@spass$ && #SecurityPhrase$!=.@spass$)
{set @Attempt,@Attempt+1; mes "INCORRECT!!";
if (@Attempt>=3){atcommand "@ban "+@BanTime+"mn "+strcharinfo(0)+""; end;}
next; goto InputSecurityPass;}
close;
end;
}
function script Set_AcctSecure {
set .@npcName$,"[^0000FF Security Personel ^000000]";
menu "Set up a Security Password",iSP,"Information on System",iSI,"Cancel",cancel;
iSP:
next;
mes .@npcName$;
mes "Very well then. Please enter a Password.";
mes "It may contain 4-32 alphanumeric characters";
mes "(A-Z) & (1-0) are all alphanumeric characters.";
input .@Npassword$;
set @Npassword$,.@Npassword$;
next;
mes "Please enter your password again for confirmation.";
input .@Npassword$;
if (.@Npassword$!=@Npassword$){mes "The Passwords did not match. Try again by talking to a security personel."; goto iSP;}
set #SecurityPass$,@Npassword$;
next;
mes "Your password was set successfully.";
next;
goto iRecoveryPhrase;
iRecoveryPhrase:
mes "Now then. Please enter a Recovery Phrase";
mes "This phrase will be used in case you forget your password.";
input .@RecovPhrase$;
if (.@RecovPhrase$==#SecurityPass$){mes "Your Recovery-Phrase cannot be the same as your Password. Please try agian."; next; goto iRecoveryPhrase;}
set @RecovPhrase$,.@RecovPhrase$;
next;
mes "Please input your Recovery Phrase again for confirmation.";
input .@RecovPhrase$;
if (@RecovPhrase$!=.@RecovPhrase$){mes "The Recovery Phrases did not match. Try again by talking to a security personel."; next; goto iRecoveryPhrase;}
set #RecoveryPhrase$,@RecovPhrase$;
next;
mes "Your Recovery Phrase was set successfully.";
mes "Please write this down. It will be used if you forgot your password.";
mes "Here it is:";
mes "^0000FF"+#RecoveryPhrase$+"^000000";
mes "WRITE IT DOWN !!";
close;
iSI:
next;
mes .@npcName$;
mes "This system is a unique system that will allow you to have a second password for your account.";
mes "In other words, after you login at the login screen, our security personel will ask you to enter your Security Password.";
mes "This will prevent others from hacking into your account while you're away.";
next;
mes .@npcName$;
mes "That is all there is to this system.";
mes "So, what would you like to do?";
callfunc "Set_AcctSecure";
end;
cancel:
close;
}

Автор: Kill Spirit: Дата: 05.22.2010

Цитата Renegade;23843:
встречный вопрос- ты когда-нибудь кодил на любом из языков программирования?


Лучшеб не спрашивал, а помог...

А х.... его...

Автор: Renegade: Дата: 05.22.2010

#nomn: Варн. Не устраивают вопросы - не отвечай. Следующий раз будет бан.

что не так? где ты увидел что меня тут что-то не устраивает?

Автор: Kill Spirit: Дата: 05.22.2010

Просто можно написать переделанный скрипт +_+

Автор: Kill Spirit: Дата: 05.23.2010

АП

Автор: DiS[IP]: Дата: 05.23.2010

[FONT=Lucida Console]Попробуй заюзать этот скрипт,вроде не плохой,даже чем-то лучше.:)

// -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-
// -o INTRUDERS SECURITY PASSWORD o
// -o (c) 2009 by Myzter o
// -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-
// -o This system detect IP Changes and o
// -o ask a second password. o
// -o Players that input the wrong pass o
// -o can't enter to the game. o
// -o o
// -o Include a OnLine Timer (just fun) o
// -o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-
///////////////////////////////////////////
// Перевод скрипта by DiS[IP] //
/////////////////////////////////////////

- script first_login -1,{

OnPCLoginEvent:
set .@cnt, query_sql("SELECT l.userid FROM login l where l.account_id = " + getcharid(3),.@LUserID$);
set .@cnt, query_logsql("SELECT l.ip FROM loginlog l where l.user = '" + .@LUserID$[0] + "' and l.rcode = 100 order by l.time desc limit 1",.@LIp$);
if (!.@cnt) end;
dispbottom "* Время: " + callfunc("Sec2",#OLTIME);
callfunc "CheckLogin",.@LIp$[0];
set #LASTIP$,.@LIp$[0];
set @GTT_Login,gettimetick(2);
if (#securitypass$ == "") dispbottom "Внимание:Ваш аккаунт не имеет секретного пароля,если хотите установить пароль подойдите к НПС 'Защита'!";
end;
OnPCLogoutEvent:
if (@NoLogin) end;
if (!@GTT_Login) end;
if (checkvending()) end;
set @LTotalTime, gettimetick(2) - @GTT_Login;
set #OLTIME, #OLTIME + @LTotalTime;
}

function script Sec2 {
set .@DD, getarg(0) / 86400;
set .@HH, (getarg(0) - .@DD * 86400) / 3600;
set .@MM, (getarg(0) - .@DD * 86400 - .@HH * 3600) / 60;
set .@SS, getarg(0) - .@DD * 86400 - .@HH * 3600 - .@MM * 60;
set .@RT$, .@DD + " day(s) ";
if (.@HH < 10) set .@RT$, .@RT$ + "0" + .@HH; else set .@RT$, .@RT$ + .@HH;
if (.@MM < 10) set .@RT$, .@RT$ + ":0" + .@MM; else set .@RT$, .@RT$ + ":" + .@MM;
if (.@SS < 10) set .@RT$, .@RT$ + ":0" + .@SS; else set .@RT$, .@RT$ + ":" + .@SS;
return .@RT$;
}

function script CheckLogin {
if (#securitypass$ == "") return;
if (#LASTIP$ == getarg(0) || #LASTIP$ == "") return;
cutin "mets_alpha.bmp",2;
mes "[^FF0000Защита аккаунта^000000]";
mes "Здраствуйте ^0000FF" + strcharinfo(0) + "^000000,пожалуйста введите свой секретный пароль или слово.";
mes "(^ff0000Найден новый IP!^000000)";
input @scpass$;
if (@scpass$ != #securitypass$) {
set @NoLogin,1;
atcommand "@die";
atcommand "@kick " + strcharinfo(0);
close;
}
set @NoLogin,0;
cutin "",255;
atcommand "@refresh";
message strcharinfo(0),"Спасибо,желаем вам приятной игры на нашем сервере!";
return;
}

prontera,100,100,5 script Защита 811,{
if gettimetick(2) - #Security < 1800) {
dispbottom "Cервис заблокирован!Попробуйте позднее!";
end;
}
l_Start:
cutin "mets_alpha.bmp",2;
mes "[^FF0000Защита аккаунта^000000]";
mes "Привет, ^0000FF" + strcharinfo(0) + "^000000!Чем могу вам помочь?";
next;
switch(select("^0000FFУстановить пароль^000000","^FF0000Информация о доп.пароле^000000","Выход")) {
case 1:
l_SetKaf:
mes "[^FF0000Защита аккаунта^000000]";
if (#securitypass$ == "") {
mes "У вас нету доп.пароля на аккаунте:";
} else {
mes "Ваш доп.пароль активирован!Пожалуйста потвердите его!:";
next;
input .@secstr$;
mes "[^FF0000Защита аккаунта^000000]";
if (.@secstr$ != #securitypass$) {
set #SecurityTry, #SecurityTry + 1;
if (#SecurityTry > 2) {
set #Security,gettimetick(2);
set #SecurityTry,0;
mes "Ошибка!Пожалуйста вспомните пароль прежде чем пользоваться сервисом.";
mes " ";
mes "[^ff0000Сервис заблокирован на 30 минут.^000000]";
close2;
goto l_Exit;
}
mes "^ff0000В доступе отказано!^000000 Пароль не правильный!";
mes " ";
mes "[^ff0000" + #SecurityTry + " / 3^000000]";
next;
goto l_SetKaf;
}
mes "Введите ваш новый доп.пароль:";
}
l_InputPass:
mes " ";
mes "(Пароль не должен состоять больше чем из 20 знаков и должен быть не мешьше 6 знаков)";
next;
input .@secstr$;
mes "[^FF0000Защита аккаунта^000000]";
if (.@secstr$ == "0") {
set #securitypass$, "";
mes "Аккаунт не имеет доп.пароля,пожалуйста напишите на ^ff0000npc:security^000000.";
close2;
set #Security,0;
set #SecurityTry,0;
goto l_Exit;
}
if(getstrlen(.@secstr$) < 6 || getstrlen(.@secstr$) > 20) {
mes "^ff0000Неверный пароль!^000000,проверьте длину пароля и попробуйте снова.";
goto l_InputPass;
}
mes "Ваш пароль:";
mes " ";
mes "^c0c0c0" + .@secstr$ + "^000000";
next;
if(select("^0000ffХорошо!^000000","^ff0000Изменить!^000000") == 2) {
mes "[^FF0000Защита аккаунта^000000]";
mes "Пожалуйста введите новый пароль:";
goto l_InputPass;
}
et #securitypass$, .@secstr$;
set #Security,0;
set #SecurityTry,0;
mes "[^FF0000Защита аккаунта^000000]";
mes "Ваш дополнительный пароль активирован!Пожалуйста,не сообщайте его никому!";
close2;
goto l_Exit;
case 2:
mes "[^FF0000Защита аккаунта^000000]";
mes "Информация: ^0000ffДополнительный пароль^000000 защищает ваш аккаунт от взлома другими IP адрессами.";
next;
mes "[^FF0000Защита аккаунта^000000]";
if (#securitypass$ == "") {
mes "Пожалуйста,установите на ваш аккаунт дополнительный пароль!";
next;
} else {
mes "Пожалуйста,не забывайте свой пароль!";
next;
}
goto l_Start;
}
mes "[^FF0000Защита аккаунта^000000]";
mes "Желаю вам удачи!";
close2;
l_Exit:
cutin "",255;
}
[/FONT]

Автор: DiS[IP]: Дата: 05.23.2010

[FONT=Lucida Console]Посмотрел сейчас тот скрипт,написан он конечно же убого,явно руки у того кто это писал торчат и задницы.
В 161 и 162 строке отсутствовала {.Сам скрипт в конце не закрывался.
После 175 строки отсутствовали 3 {.Ну и пару еще багов в функции.
Скрипт поправил,проверил.Мап сервер не ругается больше.:)
P.S:Насчет 46 % процентов ты конечно же приувеличил немного.;)
Скрипт:

///////////////////////////////////
//Идея скрипта by Midnight //
//Написание скрипта by GmOcean //
//Исправление багов by DiS[IP]//
///////////////////////////////

prontera,150,150,5 script Midgard Security 413,{
set .@npcName$,"[^0000FF Security Personel ^000000]";
mes .@npcName$;
mes "Welcome! I am a member of Midgard's Security.";
mes "As such, it is my job to ensure account safety of our players.";
mes "That is of course if they wish to use our service.";
next;
mes "So, what would you like to do?";
goto LacctCheck;
LacctCheck:
menu "Enable / Disable Security",iAD,"Change Password",iCP,"Change RecoveryPhrase",iRP,"View Password Attempts",iVP,"Cancel",cancel;
iAD:
if (#SecurityPass$!="NoPopUp"){set #SecurityPass$,"NoPopUp"; mes "Security is now turned OFF."; close;}
if (#SecurityPass$=="NoPopUp")
{next;
mes "Input a new Password";
input .@CSpassword$;
if (.@CSpassword$==#RecoveryPhrase$){next; mes "Your Password cannot be the same as your Recovery-Phrase. Please try agian."; goto iAD;}
set @CSpassword$,.@CSpassword$;
next;
mes "Input it again for confirmation.";
input .@CSpassword$;
if (.@CSpassword$!=@CSpassword$){mes "That is incorrect. Try again."; close;}
set #SecurityPass$,@CSpassword$;
mes "Security is now turned ON.";
next;
goto iRecoveryPhrase;
iRecoveryPhrase:
mes "... ... ... ...";
mes "Now then, please input a recovery phrase";
mes "This phrase will be used to recover your password, in case you forget it.";
input .@RecoveryPhrase$;
if (.@RecoveryPhrase$==#SecurityPass$){next; mes "Your Recovery-Phrase cannot be the same as your Password. Please try again."; next; goto iRecoveryPhrase;}
set @RecoveryPhrase$,.@RecoveryPhrase$;
next;
mes "Input it again for confirmation.";
input .@RecoveryPhrase$;
if (@RecoveryPhrase$!=.@RecoveryPhrase$){mes "Those phrases don't match. Please try again."; close;}
set #RecoveryPhrase$,@RecoveryPhrase$;
mes "Please write this phrase down. It will be used to recover your password should you ever forget it.";
next;
mes "Once again, here it is:";
mes "^0000FF"+#RecoveryPhrase$+"^000000";
mes "WRITE IT DOWN ! ";
goto iSecurityPhrase;
iSecurityPhrase:
next;
mes "Now Input a Security Phrase. This is slightly different, from the recovery phrase.";
mes "It will be used, to notify the GM that you have forgotten your password and recovery phrase.";
input .@SecurityPhrase$;
if (.@SecurityPhrase$==#RecoveryPhrase$ || .@SecurityPhrase$==#SecurityPass$){next; mes "Your Security Phrase cannot be the same as your Password OR Recovery Phrase"; goto iSecurityPhrase;}
set #SecurityPhrase,.@SecurityPhrase;
mes "Make sure to keep this phrase safe, and do not share it with others.";
close;}
end;
iCP:
next;
mes .@npcName$;
if (#SecurityPass$=="NoPopUp"){mes "You don't have a password set."; mes "^0000FFPlease go set one by enabling the security.^000000"; close;}
mes "Very well then. Please Enter your Current Security Password.";
input .@CSpassword$;
if (.@CSpassword$!=#SecurityPass$){next; mes "That is incorrect. Try again."; close;}
next;
mes "Now then. Please Enter your new Security Password.";
input .@NSpassword$;
if (.@NSpassword$==#RecoveryPhrase$){next; mes "Your Password cannot be the same as your Recovery-Phrase. Please try agian."; goto iCP;}
set @NSpassword$,.@NSpassword$;
next;
mes "Please Enter it again for confirmation.";
input .@CNSpassword$;
if (@NSpassword$!=.@CNSpassword$){next; mes "That is incorrect. Try again."; close;}
set #SecurityPass$,.@CNSpassword$;
next;
mes "Your password was changed successfully. Come again.";
close;
iRP:
next;
mes .@npcName$;
if (#RecoveryPhrase$=="")
{mes "You don't have a Recovery Phrase set.";
mes "Please set one by enabling the Security.";
close;}
mes "Very well then. Please Enter your Current Recovery Phrase.";
input .@RecovPhrase$;
if (.@RecovPhrase$!=#RecoveryPhrase$){next; mes "That is incorrect. Try again."; close;}
next;
mes "Now then. Please Enter your new Recovery Phrase.";
input .@NRP$;
if (.@NRP$==#SecurityPass$){next; mes "Your Recovery-Phrase cannot be the same as your Password. Please try again."; goto iRP;}
set @NRP$,.@NRP$;
next;
mes "Please enter it again for confirmation.";
input .@NRP$;
if (@NRP$!=.@NRP$){next; mes "Those phrases don't match. Try again."; close;}
set #RecoveryPhrase$,@NRP$;
next;
mes "Your Recovery Phrase was changed successfully.";
mes "Please write it down. It will be used in case you forget your password.";
next;
mes "Here it is:";
mes "^0000FF"+#RecoveryPhrase$+"^000000";
mes "WRITE IT DOWN !";
close;
iVP:
next;
mes .@npcName$;
mes "Alright. Here you go.";
mes "There have been in total: ^0000FF"+#SecurityAttempt+"^000000 password attempts.";
close;
cancel:
close;
OnPCLoginEvent:
set .@npcName$,"[^0000FF Security Personel ^000000]";
set @BanTime,5;
if (#SecurityPass$=="")
{mes .@npcName$;
mes "This server has a unique system which allows you to have a SECOND password.";
mes "This is of course optional. Would you like to use it?";
menu "Yes, set it up.",iYes,"No, and please stop showing up.",iNo;
iYes:
next;
callfunc "Set_AcctSecure";
iNo:
set #SecurityPass$,"NoPopUp";
percentheal 100,100;
mes "Alright then. Just remember, if you're interested, talk to the Security Personel in prontera.";
close;
end;}
if (#SecurityPass$=="NoPopUp"){set @SecurityPass,1; end;}
if (#SecurityPass$!="NoPopUp" && #SecurityPass$==#SecurityPass$)
{sc_start 112,999999999,100;
sc_start 1,999999999,100;
sc_start 8,999999999,100;
goto InputSecurityPass;}
end;
OnPCLoadMapEvent:
getmapxy(@Map$,@X,@Y,0);
if (@Map$=="prontera" || @Map$!="prontera"){
if (@SecurityPass==0 && #SecurityPass$!="NoPopUp" && #SecurityPass$==#SecurityPass$)
{goto InputSecurityPass;}
if (@SecurityPass==0 && #SecurityPass$=="NoPopUp"){set @SecurityPass,1; end;}
if (@SecurityPass==1){end;}
end;
}
InputSecurityPass:
mes "This account is protected by Midgard Security Personel.";
mes "Input your password to continue playing.";
mes "OR";
mes "Input your Recovery-Phrase in case you lost your password.";
mes "OR";
mes "Input your Security-Phrase in the case you lost both of the above.";
input .@spass$;
if (#RecoveryPhrase$==.@spass$)
{next;
mes "Here is your password, don't lose it again.";
mes "^0000FF"+#SecurityPass$+"^000000";
next; goto InputSecurityPass;}
if (#SecurityPass$==.@spass$)
{mes "That is correct"; set @SecurityPass,1; sc_end 1; sc_end 112; sc_end 8;
percentheal 100,100; close; end;}
if (#SecurityPhrase$==.@spass$){
for(set .@i,0; .@i if (!$LP_ACCT_ID[.@i]){
setarray $LP_ACCT_ID[.@i],getcharid(3,strcharinfo(0));
setarray $LP_USER_NM[.@i],strcharinfo(0);
next;
mes "Your name has been registered on the list of Lost-Passwords.";
mes "Your information will be reset, 1 hour AFTER a GM checks validates you.";
atcommand "@kick "+strcharinfo(0)+""; close;}
if (#SecurityPass$!=.@spass$ && #RecoveryPhrase$!=.@spass$ && #SecurityPhrase$!=.@spass$)
{set @Attempt,@Attempt+1; mes "INCORRECT!!";
if (@Attempt>=3){atcommand "@ban "+@BanTime+"mn "+strcharinfo(0)+""; end;}
next; goto InputSecurityPass;}
close;
end;
}
}
}
function script Set_AcctSecure {
set .@npcName$,"[^0000FF Security Personel ^000000]";
menu "Set up a Security Password",iSP,"Information on System",iSI,"Cancel",cancel;
iSP:
next;
mes .@npcName$;
mes "Very well then. Please enter a Password.";
mes "It may contain 4-32 alphanumeric characters";
mes "(A-Z) & (1-0) are all alphanumeric characters.";
input .@Npassword$;
set @Npassword$,.@Npassword$;
next;
mes "Please enter your password again for confirmation.";
input .@Npassword$;
if (.@Npassword$!=@Npassword$){mes "The Passwords did not match. Try again by talking to a security personel."; goto iSP;}
set #SecurityPass$,@Npassword$;
next;
mes "Your password was set successfully.";
next;
goto iRecoveryPhrase;
iRecoveryPhrase:
mes "Now then. Please enter a Recovery Phrase";
mes "This phrase will be used in case you forget your password.";
input .@RecovPhrase$;
if (.@RecovPhrase$==#SecurityPass$){mes "Your Recovery-Phrase cannot be the same as your Password. Please try agian."; next; goto iRecoveryPhrase;}
set @RecovPhrase$,.@RecovPhrase$;
next;
mes "Please input your Recovery Phrase again for confirmation.";
input .@RecovPhrase$;
if (@RecovPhrase$!=.@RecovPhrase$){mes "The Recovery Phrases did not match. Try again by talking to a security personel."; next; goto iRecoveryPhrase;}
set #RecoveryPhrase$,@RecovPhrase$;
next;
mes "Your Recovery Phrase was set successfully.";
mes "Please write this down. It will be used if you forgot your password.";
mes "Here it is:";
mes "^0000FF"+#RecoveryPhrase$+"^000000";
mes "WRITE IT DOWN !!";
close;
iSI:
next;
mes .@npcName$;
mes "This system is a unique system that will allow you to have a second password for your account.";
mes "In other words, after you login at the login screen, our security personel will ask you to enter your Security Password.";
mes "This will prevent others from hacking into your account while you're away.";
next;
mes .@npcName$;
mes "That is all there is to this system.";
mes "So, what would you like to do?";
callfunc "Set_AcctSecure";
end;
cancel:
close;
}
[/FONT]