Jump to content
  • 0

Script


Kakaroto

Question


  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  638
  • Reputation:   95
  • Joined:  05/11/12
  • Last Seen:  

Hello good afternoon, someone could help me with this script?

 

//===== rAthena Script =======================================
//= 300 Monster Challenege
//===== By: ==================================================
//= Arcenciel
//===== Version and Changes ==================================
//= 1.0   - Initial Release
//===== Description: =========================================
//= Script creates an instance in which a party is to fight
//= 300 monsters and 1 MvP, both of which are randomly chosen
//= from a predefined list. Script is highly configurable.
//===== Additional Comments: =================================
//= Requires custom map files and client side edits. Both of
//= which were provided in the release topic of this script.
//============================================================

prontera,155,188,4    script    Challenge#1-1    459,{

//===== Configurations =======================================
//= Name of the NPC that appears in NPC dialogues.
set .@npcname$,"Gorge";
//= Users higher or equal this level will not be able to take on the challenge.
set .@maxlvl,150;
//= Number of people allowed in a party to take on the challenge.
set .@maxpartymembercount,3;
//= How much time in seconds is given to the party to complete the challenge. Default: 10 Minutes
set .@durationalive,600;
//= Sets whether other party members would get the quest as well. 0 = disabled | 1 = enabled
set .@giveothersquest,1;
//= Sets whether the script will check other party members for requirements. 0 = disabled | 1 = enabled
set .@docheck,1;
//= Checks if the other party members have the quest time limit. 0 = disabled | 1 = enabled
set .@questothers,1;
//= Checks if the other party members are higher or equal to the max level allowed. 0 = disabled | 1 = enabled
set .@lvlothers,1;
//= How many treasure chest should each party member recieve.
set .@rewardcount,1;
//= Tier One - Monster ID and Name
setarray .@chamonid[0],1015,1023,1122;
setarray .@chamonname$[0],"Zombie","Orc","Goblin";
//= Tier Two - Monster ID and Name
setarray .@chamonid2[0],1197,1273,1258;
setarray .@chamonname2$[0],"Zombie Prisoner","Orc Lady","Goblin Archer ";
//= Tier Three - Monster ID and Name
setarray .@chamonid3[0],1865,1213,1308;
setarray .@chamonname3$[0],"Ragged Zombie","High Orc","Panzer Goblin";
//= Last Tier [MVP] - Monster ID and Name
setarray .@chamonid4[0],1871,1190,1785;
setarray .@chamonname4$[0],"Fallen Bishop Hibram","Orc Lord","Atroce";
//= Treasure - Mob ID
setarray .@chamonid5[0],1337,1329,1946,1938;
//===== End of Configurations ================================

mes "[ ^0033CC"+.@npcname$+"^000000 ]";
if ((checkquest(70000,PLAYTIME) == -1) || (checkquest(70000,PLAYTIME)== 2)) {

    set .@talkname,getcharid(3,strcharinfo(0));
    set .@party_id,getcharid(1);
    set .@ins_mas,getpartyleader(.@party_id,2);
    getpartymember(.@party_id,0);
    set .@partymembercount,$@partymembercount;
    copyarray .@partymembername$[0],$@partymembername$[0],.@partymembercount;
    getpartymember(.@party_id,1);
    copyarray .@partymembercid[0],$@partymembercid[0] ,.@partymembercount;
    getpartymember(.@party_id,2);
    copyarray .@partymemberaid[0],$@partymemberaid[0] ,.@partymembercount;

    mes "Have you heard of the legendary party who has defeated 300 monsters?";
    next;
    mes "[ ^0033CC"+.@npcname$+"^000000 ]";
    mes "BAHAHA! You're talking to one of the members right now! Do you think you can accomplish the same thing we did?!";
    next;
    mes "[ ^0033CC"+.@npcname$+"^000000 ]";
    mes "Listen kid..I have an arena set up where you can attempt to complete this task. How bout we make a bet!?";
    next;
    mes "[ ^0033CC"+.@npcname$+"^000000 ]";
    mes "I'll let you take on the challenge and you'll get a chance to win a treasure chest full of stuff in the end!";
    next;
    mes "[ ^0033CC"+.@npcname$+"^000000 ]";
    mes "So how bout it...";
    mes "Do you want to take it on?!";
    if (select("Yeah, Bring it!:No, Maybe next time") == 2) {
        next;
        mes "[ ^0033CC"+.@npcname$+"^000000 ]";
        mes "Ha! I knew you couldn't do it!";
        close;
    }
    next;
    mes "[ ^0033CC"+.@npcname$+"^000000 ]";
    if ( BaseLevel >= .@maxlvl ) {
        mes "Is that a scar? You seem to have been through a lot already. Only users lower than Level ^ff0000"+.@maxlvl+"^000000 can take on the challenge.";
        close;
    }
    if ( (.@party_id == 0) || (.@partymembercount < .@maxpartymembercount) ) {
        mes "You can't do this alone! I would have been killed without my comrades. You have to be in a ^ff0000"+.@maxpartymembercount+" - member party^000000 in order to do the challenge.";
        close;
    }
    if ( (.@partymembercount > .@maxpartymembercount) ) {
        mes "Your party is too big. Cut down on some members. I only need ^ff0000"+.@maxpartymembercount+"^000000 people.";
        close;
    }
    if ( getcharid(0) != .@ins_mas ) {
        mes "Party members need to listen to the party leader or everything falls apart. ^ff0000Only party leaders can set up challenge^000000. Tell your leader to come talk to me.";
        close;
    }
    for( set .@i, 0; .@i < .@partymembercount; set .@i, .@i +1 ) {
        if ( isloggedin(.@partymemberaid[.@i],.@partymembercid[.@i]) == 0 ) {
            attachrid(.@talkname);
            mes "One of your party members is offline. Either kick them out or you won't be able to proceed.";
            if ( .@instance  > 0 ) instance_destroy (.@instance);
            close;
        }
        attachrid(getcharid(3,.@partymembername$[.@i]));
        if ( checkquest(70000,PLAYTIME) == 2) {
            dispbottom "You can now enter the 300 Monster Challenge Room";
            erasequest 70000;
        }
        detachrid;
    }
    attachrid(.@talkname);
    if ((.@docheck == 1)) {
        mes "Let me just check your party for requirements...";
        sleep2 500;
        for( set .@i, 0; .@i < .@partymembercount; set .@i, .@i +1 ) {
            if ( isloggedin(.@partymemberaid[.@i],.@partymembercid[.@i]) == 0 ) {
                attachrid(.@talkname);
                mes "One of your party members is offline. Either kick them out or you won't be able to proceed.";
                if ( .@instance  > 0 ) instance_destroy (.@instance);
                close;
            }
            attachrid(getcharid(3,.@partymembername$[.@i]));
            if ((.@lvlothers == 1) && (BaseLevel >= .@maxlvl) ) {
                attachrid(.@talkname);
                mes .@partymembername$[.@i]+": Level is too high";
                set .@docheck, 2;
                detachrid;
                attachrid(getcharid(3,.@partymembername$[.@i]));
            }
            if ( (.@questothers == 1) && ((checkquest(70000) == 0) || (checkquest(70000) == 1)) ) {
                attachrid(.@talkname);
                mes .@partymembername$[.@i]+": Is still wounded and not ready to fight.";
                set .@docheck, 2;  
                detachrid;
                attachrid(getcharid(3,.@partymembername$[.@i]));
            }
            detachrid;
        }
        attachrid(.@talkname);
        if ((.@docheck == 2)) {
            mes "You might want to fix the problems above. Come back when they're fixed and I'll let you through.";
            close;
        } else {
            sleep2 2000;
            mes "Everything seems to be in order.";
            next;
        }
    }
    
    mes "[ ^0033CC"+.@npcname$+"^000000 ]";
    mes "Don't die kid!";
    mes "You and your party will be warped immediately.";
    set .@instance,instance_create("300 Monsters",.@party_id);
    
    if ( .@instance < 0 ) {
        next;
        mes "[ ^0033CC"+.@npcname$+"^000000 ]";
        mes "Something seemed to have went awry...";
        mes "You can't attempt this challenge at this moment.";
        mes "Come back later.";
        close;
    }
    
    instance_attachmap ("1@gvs5",.@instance);
    instance_attach(.@instance);
    instance_set_timeout .@durationalive,60,.@instance;
    instance_init(.@instance);

    set .@chanum,rand(getarraysize(.@chamonid));
    set 'chamonid,.@chamonid[.@chanum];
    set 'chamonname$,.@chamonname$[.@chanum];
    set 'chamonid2,.@chamonid2[.@chanum];
    set 'chamonname2$,.@chamonname2$[.@chanum];
    set 'chamonid3,.@chamonid3[.@chanum];
    set 'chamonname3$,.@chamonname3$[.@chanum];
    set 'chamonid4,.@chamonid4[.@chanum];
    set 'chamonname4$,.@chamonname4$[.@chanum];
    copyarray 'chamonid5[0],.@chamonid5[0],getarraysize(.@chamonid5);
    set 'npcname$,.@npcname$;
    set 'instid,.@instance;
    set 'maxpartymembercount,.@maxpartymembercount;
    set 'party_id,.@party_id;
    set 'rewardcount,.@rewardcount;

    donpcevent instance_npcname("#Initial Wave", instance_id())+"::OnInstanceInit";
    donpcevent instance_npcname("Challenge#1-3", instance_id())+"::OnInstanceInit";
    donpcevent instance_npcname("#MvP Summoner", instance_id())+"::OnInstanceInit";
    donpcevent instance_npcname("#Instance Destroy", instance_id())+"::OnInstanceInit";

    if ((.@giveothersquest == 1)) {
        for( set .@i, 0; .@i < .@partymembercount; set .@i, .@i +1 ) {
            if ( isloggedin(.@partymemberaid[.@i],.@partymembercid[.@i]) == 0 ) {
                attachrid(.@talkname);
                mes "One of your party members is offline. Either kick them out or you won't be able to proceed.";
                if ( .@instance  > 0 ) instance_destroy (.@instance);
                close;
            }
            attachrid(getcharid(3,.@partymembername$[.@i]));
            if (checkquest(70000)== -1) setquest 70000;
            detachrid;
        }
    attachrid(.@talkname);
    }
    
    if ((checkquest(70000)== -1)) { setquest 70000; }
    sleep2 1000;
    warpparty "1@gvs5",49,40,.@party_id;
    end;

} else if ( (checkquest(70000,PLAYTIME) == 0) || (checkquest(70000,PLAYTIME) == 1) ) {
    mes "Is that wound still bleeding?! Come back later when you're fully healed and well rested.";
    close;
}}

1@gvs5,51,41,4    script    Challenge#1-2    459,{

getpartymember('party_id);
mes "[ ^0033CC"+ 'npcname$+"^000000 ]";;
    if ( ($@partymembercount != 'maxpartymembercount) ){
        mes "Are you trying to scam me?!";
        mes "You can't sneak an extra person in for extra help!";
        close2;
        for( set 'i, 0; 'i < $@partymembercount; set 'i, 'i +1 ) {
            atcommand "@request "+$@partymembername$['i]+" tried to use a loophole in an NPC.";
            atcommand "@jail "+$@partymembername$['i];
            logmes  $@partymembername$['i]+", tried to use a loophole in an NPC.";
        }
        instance_destroy ('instid);
        end;
    }    
    mes "Are you ready? Do note your time is still running.";
    if (select("Yeah, Let's go!:No, Hold on.") == 2) {
        next;
        mes "[ ^0033CC"+ 'npcname$+"^000000 ]";;
        mes "Clock is ticking for you but I got all day.";
        close;
    }
    next;
    mes "[ ^0033CC"+ 'npcname$+"^000000 ]";;
    mes "Don't die kid!";
    close2;
    donpcevent instance_npcname("Challenge#1-3", instance_id())+"::OnEnable";
    end;
}

1@gvs5,51,41,4    script    Challenge#1-3    459,{
    end;
    
OnInstanceInit:
    disablenpc instance_npcname("Challenge#1-3", instance_id());
    end;

OnEnable:
    disablenpc instance_npcname("Challenge#1-2", instance_id());
    enablenpc instance_npcname("Challenge#1-3", instance_id());
    initnpctimer;
    end;
    
OnTimer1000:
    instance_announce 0,'npcname$+": Couldn't you all get here any faster?!",bc_map;
    end;

OnTimer9000:
    instance_announce 0,'npcname$+": Here is what's going to happen..so listen up..",bc_map;
    end;
    
OnTimer17000:
    instance_announce 0,'npcname$+": Once I get outta here, the monsters are going to be released",bc_map;
    end;

OnTimer25000:
    instance_announce 0,'npcname$+": Your job is to kill ALL the monsters till none are standing.",bc_map;
    end;

OnTimer33000:
    instance_announce 0,'npcname$+": However, more monsters will come the more you kill. Stick together! Got that?",bc_map;
    end;
    
OnTimer41000:
    instance_announce 0,'npcname$+": Cause once your party is wiped. It's over. You'll have to wait to try again...",bc_map;
    end;
    
OnTimer49000:
    instance_announce 0,'npcname$+": Now ya'll better get your weapons out and spells ready....anytime now..",bc_map;
    end;

OnTimer57000:
    instance_announce 0,'npcname$+": And Oh...DON'T LOSE A LIMB!",bc_map;
    end;
    
OnTimer65000:
    instance_announce 0,'npcname$+": Here they come! I'll see ya'll afterwards if ya'll make it alive!",bc_map;
    end;

OnTimer68000:    
    donpcevent instance_npcname("#Initial Wave", instance_id())+"::OnEnable";
    disablenpc instance_npcname("Challenge#1-3", instance_id());
    specialeffect 304;
    stopnpctimer;
    end;
}

1@gvs5,18,52,0    script    #Initial Wave    -1,{
end;

OnInstanceInit:
    disablenpc instance_npcname("#Initial Wave", instance_id());
    end;

OnEnable:
    enablenpc instance_npcname("#Initial Wave", instance_id());
    set 'monscount, 300;
    instance_announce 0,'monscount+" "+'chamonname$+" left",bc_map;
    monster "1@gvs5",0,0,'chamonname$,'chamonid,30,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";
    end;

OnMyMobDead:
    set 'monscount, 'monscount - 1;
    if ( 'monscount == 0 ) {
        donpcevent instance_npcname("#MvP Summoner", instance_id())+"::OnEnable";
        end;
    }
    instance_announce 0,'monscount+" monster[s] left",bc_map;
    if ( ('monscount == 280) && ('monscount != 0) ) {
        monster "1@gvs5",0,0,'chamonname$,'chamonid,30,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";
    }
    if ( ( ('monscount == 260) ||('monscount == 240) )  && ('monscount != 0) ) {
        monster "1@gvs5",0,0,'chamonname$,'chamonid,20,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";
        monster "1@gvs5",0,0,'chamonname2$,'chamonid2,10,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";    
    }
    if ( ( ('monscount == 220) ||('monscount == 200) )  && ('monscount != 0) ) {
        monster "1@gvs5",0,0,'chamonname$,'chamonid,15,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";
        monster "1@gvs5",0,0,'chamonname2$,'chamonid2,15,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";    
    }
    if ( ( ('monscount == 180) ||('monscount == 160) )  && ('monscount != 0) ) {
        monster "1@gvs5",0,0,'chamonname$,'chamonid,10,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";
        monster "1@gvs5",0,0,'chamonname2$,'chamonid2,20,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";    
    }
    if ( ('monscount == 140)  && ('monscount != 0) ) {
        monster "1@gvs5",0,0,'chamonname2$,'chamonid2,20,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";
        monster "1@gvs5",0,0,'chamonname3$,'chamonid3,10,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";        
    }
    if ( ('monscount == 120 )  && ('monscount != 0) ) {
        monster "1@gvs5",0,0,'chamonname2$,'chamonid2,15,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";
        monster "1@gvs5",0,0,'chamonname3$,'chamonid3,15,instance_npcname("#Initial Wave", instance_id())+"::OnMyMobDead";        
    }
    end;
    
}

1@gvs5,18,52,0    script    #MvP Summoner    -1,{
end;

OnInstanceInit:
    disablenpc instance_npcname("#MvP Summoner", instance_id());
    end;
    
OnEnable:
    enablenpc instance_npcname("#MvP Summoner", instance_id());
    instance_announce 0,'npcname$+": The final monster will be released in 10 seconds. Get ready!",bc_map;
    initnpctimer;
    end;
    
OnTimer10000:
    instance_announce 0,'npcname$+": The final monster has been released. Kill it and you're done!",bc_map;
    monster "1@gvs5",0,0,'chamonname4$,'chamonid4,1,instance_npcname("#MvP Summoner", instance_id())+"::OnMyMVPDead";
    stopnpctimer;
    end;
    
OnMyMVPDead:
    instance_announce 0,'npcname$+": Congratulations! The treasure chest is yours!",bc_map;
    getpartymember('party_id);
    set 'trecount,$@partymembercount * 'rewardcount;
    for( set 'i, 0; 'i < ($@partymembercount * 'rewardcount); set 'i, 'i +1 ) {
        set 'randnum,rand(getarraysize('chamonid5));
        monster "1@gvs5",44 + 'i,40,"Treasure Chest",'chamonid5['randnum],1,instance_npcname("#MvP Summoner", instance_id())+"::OnChestBreak";
    }
    end;
    
OnChestBreak:
    set 'trecount,'trecount - 1;
    instance_announce 0,"A chest has been opened by "+strcharinfo(0),bc_map;
    if (('trecount == 0)) {
        enablenpc instance_npcname("#Instance Destroy", instance_id());
        donpcevent instance_npcname("#Instance Destroy", instance_id())+"::OnEnable";
    }
    end;
}

1@gvs5,18,52,0    script    #Instance Destroy    -1,{
end;

OnInstanceInit:
    disablenpc instance_npcname("#Instance Destroy", instance_id());
    end;
    
OnEnable:
    enablenpc instance_npcname("#Instance Destroy", instance_id());
    instance_announce 0,"Instance will be destroyed in 10 seconds...",bc_map;
    initnpctimer;
    end;
    
OnTimer10000:
    instance_destroy ('instid);
    stopnpctimer;
    end;
}

1@gvs5    mapflag    nomemo
1@gvs5    mapflag    noreturn
1@gvs5    mapflag    nosave    SavePoint
1@gvs5    mapflag    noteleport
1@gvs5    mapflag    nowarp
1@gvs5    mapflag    nowarpto
1@gvs5    mapflag    partylock

 

 

cKpb9GZ.png

 

 
 
thank you very much from now anyone who can help me ....

 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   38
  • Joined:  04/28/13
  • Last Seen:  

The comand "instance_create" is:

 

  • instance_create("<instance name>");

 

 

On your script it is:

instance_create("300 Monsters",.@party_id);

Im not sure if you can put "300 Monsters", .@party_id.

Try with:

instance_create("300 Monsters");
Edited by Promise
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  638
  • Reputation:   95
  • Joined:  05/11/12
  • Last Seen:  

 

The comand "instance_create" is:

 

  • instance_create("<instance name>");

 

 

On your script it is:

instance_create("300 Monsters",.@party_id);

Im not sure if you can put "300 Monsters", .@party_id.

Try with:

instance_create("300 Monsters");

 

 

1Y9pivm.png

 

unfortunately not solved ... but the error has changed.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  265
  • Reputation:   96
  • Joined:  09/30/14
  • Last Seen:  

Looks like you're using the really old instancing method. In rA, you don't have to use instance_attachmap as far as I know anymore. You use instance_db.txt

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  383
  • Reputation:   121
  • Joined:  03/31/12
  • Last Seen:  

Looks like you're using the really old instancing method. In rA, you don't have to use instance_attachmap as far as I know anymore. You use instance_db.txt

 

You know how to solved it? yeah i've been looking for this instance script that someone can update this.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10018
  • Reputation:   2369
  • Joined:  10/28/11
  • Last Seen:  

you're using the newer version of rathena.

your script is outdated already.

 

update your script to use these new script command and database.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  34
  • Topics Per Day:  0.01
  • Content Count:  386
  • Reputation:   38
  • Joined:  04/28/13
  • Last Seen:  

 

 

The comand "instance_create" is:

 

  • instance_create("<instance name>");

 

 

On your script it is:

instance_create("300 Monsters",.@party_id);

Im not sure if you can put "300 Monsters", .@party_id.

Try with:

instance_create("300 Monsters");

 

 

1Y9pivm.png

 

unfortunately not solved ... but the error has changed.

 

 

it has been solved, now you have another error.

 

as nova said:

 

Looks like you're using the really old instancing method. In rA, you don't have to use instance_attachmap as far as I know anymore. You use instance_db.txt

Edited by Promise
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...