Jump to content

dnote98

Members
  • Content Count

    10
  • Joined

  • Last visited

Posts posted by dnote98


  1. On 7/26/2022 at 5:20 PM, 1steric said:

    hello

     

    I am currently writing this script.

     

    This is a system that allows you to add desired options to 5 slots of all items.

     

    but i have this script I would like to modify it so that only the weapon can be given the desired option with one slot.

     

    Advice from seniors please. thank you

     

     

     

     

     

     

     

    trin_in,30,164,4    script    잠재력 개방    4_DOG01,{ 
        callsub(StartTalking);
        end;
        
    OnInit:
        /**
         * General Configuration
         */
        /* 강화 실패 확률 (0 - 99 in percent) */
        .chance_of_failure = 0;
        /* 실패 시 아이템 삭제여부 (true/false) */
        .delete_on_failure = false;
        /* 강화 필요 제니 */
        .zeny_requirement = 100000;
        /* Minimum amount of the bonus value. 
         * For negative effects or certain bonuses that require negative values
         * Maximum possible value is -INT16_MAX)
         */
        .minimum_bonus_amount = -100; // usually used with delay bonus options, although not provided in the script.
        /* Maximum amount of the bonus value. 
         * Maximum possible value is INT16_MAX */
        .maximum_bonus_amount = 10;
        /* Disable selection of bonus value (true/false) */
        .enable_random_bonus = true;
        
        /* Item Option Descriptions */
        setarray(.options$[0], "공격력", "마법 공격력", "공격속도", "시전속도", "크리티컬 데미지");
        /* Item Option Constants */
        setarray(.option_constants[0], VAR_ATKPERCENT, VAR_MAGICATKPERCENT, VAR_PLUSASPDPERCENT, DEC_SPELL_CAST_TIME, DAMAGE_CRI_TARGET);
        end;
        
    StartTalking:
        .@name$ = _("[ ^990099잠재력 개방^000000 ]");
        disable_items();
        mes(.@name$);
        mesf("안녕하세요 %s", strcharinfo(PC_NAME));
        mes("착용하고 계신 무기에 잠재력을 개방시킬 수 있어요.");
        mes("잠재력을 개방시키면 새로운 추가옵션을 얻을 수 있습니다.");
        next();
        mes(.@name$);
        mes("무기 잠재력 개방을 하시겠습니까?");
        next();
        if (select("할게요!", "아뇨 다음에요..") == 2) {
            mes(.@name$);
            mes("그래요 다음에 뵈요.");
            close();
        }
        // Build the Menu.
        setarray(.@position$[1], "상단", "갑옷", "왼손", "오른손", "걸칠것", "신발");
        .@menu$ = "";
        for (.@i = 1; .@i <= 6; ++.@i)
            .@menu$ += ((getequipisequiped(.@i)) ? getequipname(.@i) : .@position$[.@i] + "-[착용하지 않음]") + ":";
        // Select the part.
        .@equip_index = select(.@menu$);
        
        
        // Present a list of currently infused options.
        do {
            .@menu$ = "";
            .@used = false;
            // Build the menu of current options.
            for (.@i = 1; .@i <= MAX_ITEM_OPTIONS; ++.@i) {
                // call getequipoption(<equip_index>, <type>, <slot>);
                // if the return is <0, it's a script error.
                // if the return is 0, the slot is empty.
                // if the return is >0, the slot is unavailable.
                .@opt = getequipoption(.@equip_index, .@i, IT_OPT_INDEX);
                if (.@opt > 0)
                    .@menu$ += (.@i) + ") " + .options$[.@opt - 1] + ":";
                else
                    .@menu$ += (.@i) + ") ^999999Empty^000000" + ":";
            }
            // Option Slot is the actual option slot 0-MAX_ITEM_OPTIONS (@see mmo.h)
            .@option_slot = select(.@menu$);
            
            // Check for used slot and request user action if found.
            if (getequipoption(.@equip_index, .@option_slot, IT_OPT_INDEX) > 0) {
                mes(.@name$);
                mes("This slot is already used up!");
                if (select("^990000Override the slot.^000000", "Choose again.") == 2)
                    .@used = true;
                next();
            }
        } while (.@used); // loop if the slot is not to be overridden
        
        // Present a list of available bonuses.
        mes(.@name$);
        mes("Which of the following item bonuses would you like to add to this item?");
        next();
        // Build the Options!
        .@menu$ = "";
        for (.@i = 0; .@i < getarraysize(.options$); ++.@i)
            .@menu$ += (.@i + 1) + ") " + .options$[.@i] + ":";
            
        do {
            // Select the options!
            .@option_variable = select(.@menu$);
            next();
            mes(.@name$);
            mesf("You chose ^009900%s^000000!", .options$[.@option_variable - 1]);
            mes("Are you sure?");
            next();
        } while (select("Fo Shizzle.", "I'ma re-evaluate, brah.") == 2);
        
        // Select a bonus or randomise.
        if (.enable_random_bonus) {
            .@value = rand(.maximum_bonus_amount);
        } else {
            do {
                mes(.@name$);
                mesf("Please input the bonus amount of ^009900%s^000000 you want to add!", .options$[.@option_variable - 1]);
                mesf("(Min: %d, Max: %d)", .minimum_bonus_amount, .maximum_bonus_amount);
                .@ok = input(.@value, .minimum_bonus_amount, .maximum_bonus_amount);
                next();
            } while (.@ok);
        }
        
        // If there's a chance of failure, inform the user.
        if (.chance_of_failure) {
            mes(.@name$);
            mes("Alright so,");
            mes("I'll have you know...");
            mesf("There's a ^990000%d%% chance of failure^000000.", .chance_of_failure);
            mes("Because, well... I didn't go to school.");
            next();
            mes(.@name$);
            if (.delete_on_failure) {
                mes("If I fail, your item will break and it ^990000will be destroyed^000000!");
            }
            mes("Are you still ready to go forward with this?");
            next();
            if (select("Fo shizzle.", "Hells naw, go back to school.") == 2) {
                mes(.@name$);
                mes("Geez, you don't have to be so harsh about it.");
                close();
            }
            next();
        }
        
        // If there's a Zeny Requirement, perform the usual.
        if (.zeny_requirement > 0) {
            mes(.@name$);
            mesf("You also have to pay %dZ.", .zeny_requirement);
            next();
            if (select("Of course!", "No way!") == 2) {
                mes(.@name$);
                mes("Well, see you around then...");
                close();
            }
            if (Zeny < .zeny_requirement) {
                mes(.@name$);
                mes("You don't have enough Zeny!");
                close();
            }
            Zeny -= .zeny_requirement;
        }
        
        // Check if there's a chance of failure, set and roll the dice.
        if (.chance_of_failure && rand(100) <= .chance_of_failure) {
            mes(.@name$);
            mes("^990000I failed!^000000");
            mes("Guess I should go back to school.");
            // Delete the item if flagged.
            if (.delete_on_failure)
                failedrefitem(.@equip_index); // Simulate failed refinement of the item and delete.
        } else {
            // Set the Item Option bonuses in the slot see db/item_options.conf for more info.
            setequipoption(.@equip_index, .@option_slot, .option_constants[.@option_variable - 1], .@value);
            mes(.@name$);
            mes("^009900Praise Jesus^000000");
            mes("I have added an option to your item.");
            mes("My skills are flawless!");
        }
        next();
        mes(.@name$);
        mes("See you around!");
        close();
    }
     

    What you can do is remove every option besides "left hand" or "right hand" 


    EX.
    // Build the Menu.
        setarray(.@position$[1], "상단", "갑옷", "왼손", "오른손", "걸칠것", "신발");  /// << Leave only right hand or both if you want to add to shields too.
        .@menu$ = "";
        for (.@i = 1; .@i <= 6; ++.@i)  /// <<<< Here you change 6 to 1 OR 2 depending on if you want right hand or both.
            .@menu$ += ((getequipisequiped(.@i)) ? getequipname(.@i) : .@position$[.@i] + "-[착용하지 않음]") + ":";
        // Select the part.
        .@equip_index = select(.@menu$);

    So change to : 

    // Build the Menu.
        setarray(.@position$[1], "오른손");
        .@menu$ = "";
        for (.@i = 1; .@i <= 1; ++.@i)
            .@menu$ += ((getequipisequiped(.@i)) ? getequipname(.@i) : .@position$[.@i] + "-[착용하지 않음]") + ":";
        // Select the part.
        .@equip_index = select(.@menu$);


  2. On 2/8/2021 at 7:57 PM, DevilSupremeRO said:

    i need barricades here everytime they destroy the emperium on koe the barricade respawns and you have to destroy all of the barricades in order enter and destroy the emperium.

     

     

     

     

    image.png.c7a91230302f546b506efd7fca627577.png

    Anyone ever figure this out? im triyng to do the same


  3. On 11/5/2020 at 7:11 AM, AnnieRuru said:

    https://rathena.org/board/topic/126404-additional-feature-for-my-own-broadcaster-npc/?do=findComment&comment=388123

    after Tokei posted that I'm a bit fire up hahaha

     

    https://gist.github.com/AnnieRuru/cf56174c4bbbd3a61d4dd0c11100c425

    well, yes I didn't do the stuffs he said, but its do-able with SQL table or using storing them in array

    reply again if you want this feature

    is a working broadcaster npc still available? i used the one from Tokei and i get stuck after broadcasting.

     

    prontera,157,180,3    script    Broadcaster#1::BC    894,{
        .@npcname$ = "^FF9300 Broadcaster ^000000";
        .@header$ = "[^0000ff" + .@npcname$ + "^000000]";

        mes .@header$;
        mes "Hi, I'm the Broadcaster.";
        mes "I can Broadcast a message for you.";
        mes " ";
        mes " ";
        mes " ";
        mes "It costs ^ff0000" + .broadcastfee + "^000000 zeny.";
        next;
        mes .@header$;
        mes "Would you like to Broadcast?";
        next;
        
        switch (select("Yes:Nevermind:Auto-broadcast:")) {
            case 1:
                if (Broadcast > gettimetick(2)) {
                    mes .@header$;
                    mes "Sorry you have to wait for 1 min.";
                    close;
                }
                
                if (Zeny < .broadcastfee) {
                    goto L_NotEnoughZeny;
                }
                
                mes .@header$;
                mes "Please input your message.";
                next;
                input .@broadcast$;
                Zeny -= .broadcastfee;
                announce "Broadcast From " + strcharinfo(0) + ": " + .@broadcast$ + "", 0, 0x5AFF00; // Edit 5AFF00 for color code HTML Color Code
                Broadcast = gettimetick(2) + 60; //Timer 60 = 1 minute/s
                dispbottom "Broadcaster: Please wait for 1min until next broadcast to avoid flooding.";
                end;
            case 2:
                mes .@header$;
                mes "Suit yourself.";
                close;
            case 3:
                mes .@header$;
                mes "Hi, I can automatically broadcast messages for you!";
                mes "It will cost you ^ff0000" + .auto_broadcastfee + "^000000 zeny per broadcast.";
                next;
                
                .@aid = getcharid(3);
                
                switch(select("Proceed:Check status:Exit")) {
                    case 1:
                        if ($bc_announces_delay[.@aid]) {
                            mes .@header$;
                            mes "You already have an auto announce for this account.";
                            close;
                        }
                        
                        mes .@header$;
                        mes "Please input your message.";
                        next;
                        input .@broadcast$;
                        mes .@header$;
                        mes "How many times do you want to broadcast?";
                        mes "Min: 1";
                        mes "Max: 100";
                        next;
                        input .@repeat, 1, 100;
                        
                        if (.@repeat < 1 || .@repeat > 100) {
                            mes .@header$;
                            mes "Suit yourself.";
                            close;
                        }
                        
                        .@delay = 3;
                        mes .@header$;
                        mes "Delay between announces?";
                        mes "Min: 3";
                        mes "Max: 20";
                        next;
                        input .@delay, 3, 20;
                        
                        if (.@delay < 3 || .@delay > 20) {
                            mes .@header$;
                            mes "Suit yourself.";
                            close;
                        }
                        
                        .@cost = .auto_broadcastfee * .@repeat;
                        
                        mes .@header$;
                        mes "You want to broadcast:";
                        mes "^ff0000" + .@broadcast$ + "^000000";
                        mes "Every 3 minutes for ^00ff00" + .@repeat + "^000000 time(s)?";
                        mes "It will cost you a total of ^ff0000" + .@cost + "^000000 zeny.";
                        next;
                        
                        switch(select("Proceed:Cancel")) {
                            case 2:
                                mes .@header$;
                                mes "Suit yourself.";
                                close;
                        }
                        
                        if (Zeny < .@cost) {
                            goto L_NotEnoughZeny;
                        }
                        
                        Zeny -= .@cost;
                        
                        $bc_announces_timer[.@aid] = 0;
                        $bc_announces_repeat[.@aid] = .@repeat;
                        $bc_announces_delay[.@aid] = .@delay * 60;
                        $bc_announces_mes$[.@aid] = "Shout from " + strcharinfo(0) + ": " + .@broadcast$;
                        $bc_announces_aid2idx[.@aid] = $bc_announces_count;
                        $bc_announces_idx2aid[$bc_announces_count] = .@aid;
                        $bc_announces_count++;
                        close;
                    case 2:
                        if ($bc_announces_delay[.@aid] == 0) {
                            mes .@header$;
                            mes "You currently have no auto announces.";
                            close;
                        }
                        
                        mes .@header$;
                        mes "Your current announce is as follow:";
                        mes "^ff0000" + $bc_announces_mes$[.@aid] + "^000000";
                        mes "It will be announced again in " + $bc_announces_timer[.@aid] + " second(s).";
                        mes "It will repeat " + $bc_announces_repeat[.@aid] + " more time(s).";
                        next;
                        
                        switch(select("Okay:Cancel announce:")) {
                            case 1:    
                                mes .@header$;
                                mes "...";
                                close;
                            case 2:
                                mes .@header$;
                                mes "Your zeny will not be refunded, are you sure you want to cancel?";
                                next;
                                
                                switch(select("No:Yes")) {
                                    case 1:
                                        mes .@header$;
                                        mes "Suit yourself.";
                                        close;
                                }
                                
                                if ($bc_announces_delay[.@aid] == 0) {    // It already ended?
                                    end;
                                }
                                
                                callsub L_RemoveAutoAnnounce, .@aid;
                                mes .@header$;
                                mes "All done.";
                                close;
                        }
                        
                        end;
                    case 3:
                        mes .@header$;
                        mes "Suit yourself.";
                        close;
                    case 4:
                        
                        close;
                }
                
                close;
        }
        
        end;
    L_NotEnoughZeny:
        mes .@header$;
        mes "You don't have enough zeny.";
        close;
    OnTimer1000:
        freeloop(1);
        
        for (.@i = 0; .@i < $bc_announces_count; .@i++) {
            .@aid = $bc_announces_idx2aid[.@i];
            $bc_announces_timer[.@aid]--;
            
            if ($bc_announces_timer[.@aid] <= 0 && .@didannounce == false) {
                announce $bc_announces_mes$[.@aid], 0, 0x5AFF00;
                
                $bc_announces_repeat[.@aid]--;
                $bc_announces_timer[.@aid] = $bc_announces_delay[.@aid];
                
                if ($bc_announces_repeat[.@aid] <= 0) {
                    callsub L_RemoveAutoAnnounce, .@aid;
                    .@i--;
                }
                
                .@didannounce = true;    // Prevents overlapping of announces
            }
        }
        
        freeloop(0);
        initnpctimer;
        end;
    L_RemoveAutoAnnounce:
        .@aid = getarg(0);
        .@idx = $bc_announces_aid2idx[.@aid];
        
        $bc_announces_timer[.@aid] = 0;
        $bc_announces_repeat[.@aid] = 0;
        $bc_announces_delay[.@aid] = 0;
        $bc_announces_mes$[.@aid] = "";
        
        .@last_aid = $bc_announces_idx2aid[$bc_announces_count - 1];
        $bc_announces_idx2aid[.@idx] = .@last_aid;
        $bc_announces_idx2aid[$bc_announces_count - 1] = 0;
        $bc_announces_aid2idx[.@last_aid] = .@idx;
        $bc_announces_count--;
        return;
    OnInit:
        .broadcastfee = 3000000;
        .auto_broadcastfee = 500000;
        initnpctimer;
        end;
    }

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.