환생 NPC 스크립트
*/
yuno,147,187,5 script 환생NPC 866,{
function deleteItem; // Deletes Required Items
function CheckItemNeed; // Shows the Required Items
function getItemReward; // Gives the Reward
mes "^11E6D0[환생 NPC]^000000";
mes strcharinfo(0)+", 무엇을 도와줄까 젊은이?";
switch( select( "^777777~ 랭킹:~ 환생:~ 정보:~ 취소"+((getgmlevel()>=.GMLevel)?":~ 랭킹 리셋":"")+"^000000" ) ) {
case 1:
next;
mes "^11E6D0[환생 NPC]^000000";
mes "랭킹:";
query_sql "SELECT `name`,`rebirth_no`,`master_rebirth` FROM `rebirth_system` ORDER BY `master_rebirth` DESC, `rebirth_no` DESC LIMIT "+.list,@name$,@rebirth_no,@master_rebirth;
if(getarraysize(@name$)==0){mes "^F20808 기록을 찾을 수 없습니다. ^000000"; close;}
mes "포맷:";
mes "^0814F2[Character Name]^000000 - ^B308F2[Rebirths]^000000 - ^B303F2[Master_Rebirth]^000000";
for (.@i=0; .@i < getarraysize(@name$); .@i++){
mes (.@i+1) +".) ^0814F2["+ @name$[.@i] +"]^000000 - ^B308F2["+ @rebirth_no[.@i] +"]^000000 - ^B303F2["+ @master_rebirth[.@i] +"]^000000";
}
deletearray @name$[0],.list; deletearray @rebirth_no[0],.list; deletearray @master_rebirth[0],.list;
close;
case 2:
next;
mes "^11E6D0[환생 NPC]^000000";
if (.MasterRebirth>0 && rebirth_no >= .MasterRebirth){
mes "궁극의 환생술을 할 수도 있네만...";
mes "궁극의 환생술은 귀중한 아이템을 줄 수도 있다네..";
mes "궁극의 환생술을 한다면 물론 잃는 것도 있다네.."+ .MasterRebirth +" Rebirths";
if (.MaxRebirth[1]){ mes "You can do "+ .MaxRebirth[1] +" Master Rebirths Only"; }
@rebirth_type = select("일반 환생:궁극의 환생술");
next;
mes "^11E6D0[환생 NPC]^000000";
}else{
@rebirth_type = 1;
}
if ((@rebirth_type==1 && .MaxRebirth[0] > 0 && rebirth_no >= .MaxRebirth[0]) || (@rebirth_type==2 && .MaxRebirth[1] > 0 && master_rebirth >= .MaxRebirth[1]) ){
mes "You have Reached the Maximum Number of "+ ( (@rebirth_type==2)?"Master":"" ) +" Rebirths("+ ( (@rebirth_type==2)?master_rebirth:rebirth_no ) +")";
close;
}
.@eac = eaclass();
.@can_rebirth = true;
for (.@i=0; .@i<getarraysize(.add_jobs); .@i++){
if (Class==.add_jobs[.@i]){
.@can_rebirth = true;
break;
}
}
if( NextJobExp || NextBaseExp ) {
mes "환생하기 위해서는 베이스와 잡레벨을 모두 최대치로 올려야한다네.";
close;
}else if(!.@can_rebirth || !( .@eac&(.job_rebirth) ) || (.TransJob==1 && !Upper)){
mes "먼저 "+ ((.job_rebirth==EAJL_THIRD)?"Third":"2차") +" "+ ((.TransJob==1)?"전승에 도달하고 다시 찾아오게나.":"") +" Job";
close;
}
mes "아이템이 모자르네 :";
CheckItemNeed(@rebirth_type);
next;
mes "^11E6D0[환생 NPC]^000000";
deleteItem(@rebirth_type);
break;
case 3:
next;
mes "^11E6D0[환생 NPC]^000000";
switch(.reset_opt){
case 1:
case 2:
mes "젊은이의 베이스레벨과 잡레벨"+ ((.reset_opt==1)?",Skills,StatPoints And Status":" 그리고 스킬포인트도") +" 리셋이 될거라네.";
break;
case 3:
case 4:
mes "젊은이는 다시 처음으로 돌아갈 것이라네."+ ((.reset_opt==3)?"Base":"Job") +"Level 1 with JobLevel and Skills/Status Unaffected";
break;
}
mes "우선 "+ ((.job_rebirth==EAJL_THIRD)?"Third":"2차") +" "+ ((.TransJob==1)?"전직":"") +" 을 넘겨야 비로서 환생에 다다를 수 있지.";
if (.StatusN){ mes "스탯 "+ .StatusN +" 포인트를 매번 환생할 때마다 추가적으로 얻을 수 있지."; }
if (.ResetJob==2 || (.ResetJob==1 && .TransJob==0) || .@can_rebirth){ mes "그리고 하이노비스 부터 시작이라네"; }
else if ((.ResetJob==1 && .TransJob==1) || (.ResetJob==3)){ mes "그리고 하이노비스 부터 시작이라네"; }
else{ mes "환생을 해도 직업은 바뀌지 않을걸세"; }
next;
mes "^11E6D0[환생 NPC]^000000";
mes "환생을 하기 위해서는 몇가지 아니템이 필요하네.";
CheckItemNeed(1,1);
if (.MasterRebirth > 0){
next;
mes "^11E6D0[환생 NPC]^000000";
mes "환생을 "+ .MasterRebirth +"번 하면 궁극의 환생술을 펼칠수 있다네.";
if (.MaxRebirth[1]){ mes "궁극의 환생"+ .MaxRebirth[1] +" 만을 할 수 있다네."; }
if (.StatusM){ mes "스텟 "+ ((.StatusM)-(.StatusN * .MasterRebirth)) +" 포인트를 일반 환생보다 더 받을 수 있게되지."; }
mes "궁극의 환생을 마치면 몇가지 아이템을 얻을 수 있다네.";
next;
mes "^11E6D0[환생 NPC]^000000";
mes "궁극의 환생술을 펼치기 위해서는 몇가지 아이템이 필요하네.";
CheckItemNeed(2,1);
}
close;
case 4:
next;
mes "^11E6D0[환생 NPC]^000000";
mes "잘가시게나";
close;
case 5:
next;
mes "^11E6D0[환생 NPC]^000000";
mes "랭킹을 정말 리셋하시겠습니까?";
mes "완료되면 다시 되될릴수 없습니다.";
if (select("네, 리셋하겠습니다.:아니오,조금 더 생각해보겠습니다.")==2){
next;
mes "^11E6D0[환생 NPC]^000000";
mes "서비스를 이용해 주셔서 감사합니다.";
close;
}
next;
query_sql "TRUNCATE TABLE `rebirth_system`";
query_sql "DELETE FROM `char_reg_num_db` WHERE `key`='rebirth_no' OR `key`='master_rebirth'";
query_sql "SELECT `account_id` from `char` where `online`=1", .@account_id;
for (.@i=0; .@i < getarraysize(.@account_id); .@i++){
if (attachrid(.@account_id[.@i])){
if (rebirth_no){ rebirth_no = 0; }
if (master_rebirth){ master_rebirth = 0; }
}
}
deletearray .@account_id[0],getarraysize(.@account_id);
mes "^11E6D0[환생 NPC]^000000";
mes "랭킹 리셋 완료";
close;
}
if (@rebirth_type==1){rebirth_no += 1;}
else{master_rebirth += 1; rebirth_no = rebirth_no - .MasterRebirth; }
switch(.ResetJob){
case 1:
if (!Upper){
jobchange Job_Novice; break;
}
case 3: jobchange Job_Novice_High; break;
case 2: jobchange Job_Novice; break;
default: break;
}
resetlvl(.reset_opt);
if (.reset_ss&1){resetstatus;}
if (.reset_ss&2){resetskill;}
query_sql "INSERT INTO `rebirth_system` (`char_id`,`name`,`rebirth_no`,`master_rebirth`) VALUES ("+getcharid(0)+",'"+strcharinfo(0)+"',"+rebirth_no+","+master_rebirth+") ON DUPLICATE KEY UPDATE `rebirth_no`="+rebirth_no+", `master_rebirth`="+master_rebirth+" ";
getItemReward(@rebirth_type);
if (.StatusN || .StatusM){
StatusPoint = StatusPoint + (.StatusM * master_rebirth) + (.StatusN * rebirth_no);
}
mes "^11E6D0[환생 NPC]^000000";
mes "환생이 모두 끝났다네.";
if (@rebirth_type==1){
announce "[ 환생 NPC ] : "+ strcharinfo(0) +"님이 환생을 총 "+ rebirth_no +"번 하셨습니다 !", 0;
}else{
announce "[ 환생 NPC ] : "+ strcharinfo(0) +"님이 궁극의 환생을 "+ master_rebirth +"번 하셨습니다 !", 0;
}
close;
function deleteItem {
for (.@i=0 ; .@i < .size_item; .@i += 3 ){
if ( !( getarg(0)&(.item_req[.@i+2]) ) ){continue;}
delitem .item_req[.@i], ( .item_req[ .@i+1 ] );
}
return;
}
function CheckItemNeed {
if ( Weight > 20000 ) {
mes "You must reduce your weight to 2000 to do Rebirth.";
close;
}
.@error = 0;
for (.@i=0 ; .@i < .size_item; .@i += 3 ){
if ( !( getarg(0)&(.item_req[.@i+2]) ) ){continue;}
if ( countitem( .item_req[.@i] ) < .item_req[ .@i+1 ] ) {
mes "[^ff0000"+countitem( .item_req[.@i] )+" / "+ .item_req[.@i+1] +"^000000] ^112FD9"+getitemname( .item_req[.@i] )+"^000000";
.@error = 1;
}else{
mes "[^00ff00"+countitem( .item_req[.@i] )+" / "+ .item_req[.@i+1] +"^000000] ^112FD9"+getitemname( .item_req[.@i] )+"^000000";
}
}
if (.@error && !getarg(1,0)){close;}
return;
}
function getItemReward {
for (.@i=0 ; .@i < .size_reward; .@i += 4 ){
if ( !( getarg(0)&( .reward[.@i+3] ) ) ) {continue;}
if (rand(1,10000) <= .reward[.@i+2]){
mes "보상 "+.reward[.@i+1]+" "+getitemname(.reward[.@i])+" ";
getitem .reward[.@i], .reward[ .@i+1 ];
}
}
next;
return;
}
OnInit:
// item required <item ID>, <number> , <1=NormalRebirth,2=MasterRebirth,3=ForBorthRebirths>
setarray .item_req, 501, 5, 3,
502, 2, 3,
503, 3, 3;
.size_item = getarraysize( .item_req );
// rewards <item ID>, <quantity>,<chance(10000=100%)>,<1=NormalRebirth,2=MasterRebirth,3=PriceForBothRebirths>
// recalculates the chance and gives the next reward if chance is met.
setarray .reward, 504, 1, 10000, 1,
7227, 5, 10000, 2,
502, 5, 10000, 3,
601, 1, 10, 3;
.size_reward = getarraysize( .reward ); //Do not Change This
.list = 10; //Show Top x in Ranking
.job_rebirth = EAJL_2; //EAJL_THIRD = Third Job, EAJL_2 = Second Job, (EAJL_2&EAJL_THIRD) = Second and Third job can rebirth.
//More Options [EAJL_2_1,EAJL_2_2,EAJL_UPPER,EAJL_BABY]
setarray .add_jobs[0],Job_Gunslinger, //Additional Jobs, who can rebirth
Job_Soul_Linker,
Job_Star_Gladiator,
Job_Taekwon;
.TransJob = 1; //Trans Job Needed to Rebirth? (1=Yes,0=No)
.reset_opt = 2; //(1=Reset Base and JobLevel to 1(0 skill points and all stats to 1),2=Reset Base and JobLevel to 1(SkillPoint=0, While Skills and stats are not affected),3=Reset BaseLevel to 1, 4=Reset Job Level to 1)
.reset_ss = 3; //(1=Reset Status, 2=Reset Skills, 3 = Reset Status and Skills).
setarray .MaxRebirth[0],0,0; //Maximum Number of Normal Rebirth/Master Rebirth.(0=Unlimited)
.ResetJob = 1; //0=Don't Change Job, Just Reset Level,1=Reset Job to Novice/Novice_High depending upon the job, 2=Force Reset to Novice, 3=Force Reset to Novice_High
.MasterRebirth = 10; //Number of rebirths require to do Master Rebirth. (0 to disable)
.StatusN = 300; //Status Point to Give at Every Normal Rebirth.
.StatusM = (.StatusN * .MasterRebirth) + 200; //Status Point to Give at Every Master Rebirth. (Don't Change initial part)
.GMLevel = 99; //Minimum GM Level to Reset the Ranking.
query_sql "CREATE TABLE IF NOT EXISTS `rebirth_system` ( `char_id` int(11) NOT NULL default '0', `name` varchar(24) NOT NULL DEFAULT 'NULL', `rebirth_no` mediumint(6) NOT NULL default '0', `master_rebirth` mediumint(6) NOT NULL default '0', PRIMARY KEY (`char_id`)) ENGINE=MyISAM";
end;
}

Nille 님의 최근 댓글
확인~ 2019 09.21 rt 2016 05.08 감사 2016 05.02 실행안된다 2016 04.30 받아볼깨여 2016 04.24