• SEARCH

    통합검색
  • GAMEZONE
    • 커뮤니티
      • 공지사항
      • 유저게시판
        • 등업게시판
        • 출석체크
        • 정회원 무료자료실
      • 스크린샷
      • 인증자료실
    • 리니지
      • 게임공략 & 팁
      • 홍보게시판
      • 유틸자료실
      • 소스자료실
      • 자유게시판
      • 노하우 게시판
    • 메이플스토리
      • 게임공략 & 팁
      • 홍보게시판
      • 유틸자료실
      • 소스자료실
      • 자유게시판
      • 노하우 게시판
    • 바람의나라
      • 자유게시판
      • 홍보게시판
      • 자료게시판
        • 유틸자료실
        • 소스자료실
        • 클라이언트
        • 팩 자료실
      • 연구게시판
        • 개발내역
        • 질문과답변
        • 기타
      • 강의게시판
        • DR
        • CR
        • 구버전
        • 클라이언트 개조
        • 노하우 게시판
        • 게임공략 & 팁
    • 다크에덴
      • 게임공략 & 팁
      • 홍보게시판
      • 유틸자료실
      • 소스자료실
      • 자유게시판
      • 노하우 게시판
    • 믹스마스터
      • 게임공략 & 팁
      • 홍보게시판
      • 유틸자료실
      • 소스자료실
      • 자유게시판
      • 노하우 게시판
    • 라그나로크
      • 게임공략 & 팁
      • 홍보게시판
      • 유틸자료실
      • 소스자료실
      • 자유게시판
      • 노하우 게시판
    • 기타게임
      • 게임공략 & 팁
      • 홍보게시판
      • 유틸자료실
      • 소스자료실
      • 자유게시판
      • 노하우 게시판
    • 게임강의
    • 비베&포토샵
      • 자유게시판
      • 자료실
        • 일반자료실
        • 포인트 자료실
      • 노하우게시판
      • 포토샵게시판
    • 모바일
      • 게임공략
      • 포인트 자료실
      • 유틸자료실
      • 자유게시판
  • 라그나로크 소스자료실
    • 라그나로크 소스자료실 ()
    • 환생 NPC 스크립트

      • Nille
      • 2016.03.12 - 08:48 157

    */
    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;
    }

    이 게시물을..
    N
    0
    0
    • 도작도우미 npc파크시티
    • 6
      Nille

    Nille 님의 최근 글

    ccc 2016 06.23 ccc 2016 06.22 cc 2016 06.07 Func 시스템 스크립 질문이요 87 1 2016 05.17 ㅊㅊㅊ 2016 05.17

    Nille 님의 최근 댓글

    확인~ 2019 09.21 rt 2016 05.08 감사 2016 05.02 실행안된다 2016 04.30 받아볼깨여 2016 04.24
    글쓴이의 서명작성글 감추기 
    댓글 쓰기 에디터 사용하기 닫기
    • view_headline 목록
    • 14px
    • 도작도우미 npc
    • 목록
      view_headline
    × CLOSE
    기본 (166) 제목 날짜 수정 조회 댓글 추천 비추
    분류 정렬 검색
    • 소스자료는 직접 올려주세요
      2017.06.06 - 16:15 301
    166
    상수와 변수
    a74654 2025.09.24 - 19:59 16
    165
    전쟁중에혈해체 못하게
    인존 2024.03.04 - 09:52 44
    164
    운영자 버프
    인존 2024.03.04 - 09:29 88
    163
    BlackCipher64.ct
    우2우2 2023.06.10 - 21:23 160
    162
    Hercules 용 한번에 무기 10강화 해주는 NPC
    noBrand 2020.08.30 - 04:27 664
    161
    배율 이벤트 스크립트입니다.
    비트 2020.08.28 - 10:18 380
    160
    맵이름 한글화 함수 스크립트
    suazzang 2020.07.08 - 02:09 389
    159
    @잡 소스를 대체하는 스크립트 명령어
    suazzang 2020.07.08 - 02:05 268
    158
    월드이용권npc
    아이도나 2020.01.15 - 09:54 407
    157
    보스 출현 던전 및 필드가 추가된 텔레포터(자작)
    맴찢 2019.11.22 - 12:25 518
    156
    포인트샵
    asdasvw 2019.09.11 - 02:51 456
    155
    파티홍보존
    asdasvw 2019.09.05 - 03:44 335
    154
    계정매니저
    asdasvw 2019.09.05 - 03:42 290
    153
    길드랭커오라
    asdasvw 2019.09.05 - 03:41 206
    152
    힐러 엔피씨
    민민 2019.02.16 - 00:01 327
    151
    초기화 엔피씨
    민민 2019.02.16 - 00:01 254
    150
    랭크엔피시
    민민 2019.02.15 - 23:58 217
    149
    오크의 습격! (이벤트성)
    비트 2018.06.03 - 10:29 388
    148
    주사위놀이입니다.
    비트 2018.06.03 - 10:27 247
    147
    전체감정입니다.
    비트 2018.06.03 - 10:27 285
    146
    블랙 잭입니다.
    비트 2018.06.03 - 10:25 242
    145
    포링레이스
    비트 2018.06.03 - 10:25 201
    144
    타뷸라의 늑대
    비트 2018.06.03 - 10:23 229
    143
    농축제련
    이지 2018.01.29 - 16:32 324
    142
    옛고성
    이지 2018.01.29 - 16:31 260
    141
    마왕모로크 번역
    이지 2018.01.29 - 16:31 258
    140
    전직도우미
    이지 2018.01.29 - 16:30 305
    139
    스타일리스트 스크립트
    이지 2018.01.29 - 16:30 200
    138
    시간의부츠 스크립트
    이지 2018.01.29 - 16:30 171
    137
    엔들리스타워
    이지 2018.01.29 - 16:29 121
    136
    아이템디비 허큘
    이지 2018.01.29 - 16:29 161
    135
    바포미션퀘스트
    이지 2018.01.29 - 16:29 84
    134
    캐쉬스크립트
    이지 2018.01.29 - 16:27 223
    133
    이벤트명령어추가
    이지 2018.01.29 - 16:26 133
    132
    시계탑 한글화
    이지 2018.01.29 - 16:26 116
    131
    월드드랍
    이지 2018.01.29 - 16:25 115
    130
    자동제련
    이지 2018.01.29 - 16:25 165
    129
    투표도우미
    이지 2018.01.29 - 16:24 49
    128
    아이템삭제스크립트
    이지 2018.01.29 - 15:34 96
    127
    MvP 래더 게임
    이지 2018.01.29 - 15:33 58
    126
    니플헤임퀘스트
    이지 2018.01.29 - 15:32 67
    125
    아이템 이름새기기
    이지 2018.01.29 - 15:31 77
    124
    바포잡기퀘스트입니다.
    이지 2018.01.29 - 15:31 62
    123
    정착지원 엔피시
    이지 2018.01.29 - 15:30 124
    122
    힐 딜레이 힐량 변경법
    이지 2018.01.29 - 15:28 106
    121
    쉐도우장비+일반장비 제련 npc
    파크시티 2018.01.10 - 01:53 155
    120
    환생 npc
    파크시티 2018.01.10 - 01:52 122
    119
    결투장 npc
    파크시티 2018.01.10 - 01:51 77
    118
    도작도우미 npc
    파크시티 2018.01.10 - 01:50 112
    117
    서버에 접속했을때 대화창으로 알려주는 npc
    파크시티 2018.01.10 - 01:50 87
    • 1 2 3 .. 4
    • / 4 GO
  • GAMEZONE
 GAMEZONE all rights reserved.
by OrangeDay