Jump to content
  • 0

Can someone help me with an instace custom?


adrianorj

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   1
  • Joined:  12/22/15
  • Last Seen:  

Good afternoon!
I hope you can help me.
I've been trying to run an instance for 2 months, but unfortunately I could not. I wish it had 5 levels, every 10 dead monsters would appear an MVP, after the MVP died a portal would appear that would teletransporia to the next level; when it reaches the last level and the last MVP is dead 4 Treasure Chests will appear.
Note: Each normal monsters that were killed will have the chance to drop 1 coin poring, the MVP would have 50 coins poring and the treasure chest 100 coins poring.

Sorry for English, I'm Brazilian. I used Google Translator.
Thankful!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  90
  • Topics Per Day:  0.02
  • Content Count:  361
  • Reputation:   18
  • Joined:  01/09/13
  • Last Seen:  

I get your concept or what-is-it you want to do. 
try to do it using this sample script from the doc.

https://github.com/rathena/rathena/blob/master/doc/sample/instancing.txt

 

Spoiler


//===== rAthena Script =======================================
//= Sample: Instancing
//===== By: ==================================================
//= Euphy
//===== Last Updated: ========================================
//= 20140129
//===== Description: ========================================= 
//= Contains elements of a basic instance script.
//============================================================

// Before running this script, add the entry below to
// 'db/(pre-)re/instance_db.txt':
// 100,Abyss Lake Instance,3600,300,abyss_03,160,155

// Instance Creation
//============================================================
prontera,151,190,6    script    Sample Instance    101,{
    .@instance$ = "Abyss Lake Instance";

    if (instance_id()) {  // ignore the console debug message (harmless)
        mes "[Sample Instance]";
        mes "You are already part of an instance.";
        next;
        switch(select("Enter Instance.:Cancel.")) {
        case 1:
            break;
        case 2:
            mes "[Sample Instance]";
            mes "You don't want to try again?";
            emotion ET_CRY;
            close;
        }
    } else {
        mes "[Sample Instance]";
        mes "Would you like to try the sample instance in Abyss Lake 3?";
        next;
        switch(select("Create Instance.:Cancel.")) {
        case 1:
            .@create = instance_create(.@instance$);
            if (.@create < 0) {
                mes "[Sample Instance]";
                switch (.@create) {
                    case -1: mes "ERROR: Invalid type."; break;
                    case -2: mes "ERROR: Party not found."; break;
                    case -3: mes "ERROR: Instance already exists."; break;
                    case -4: mes "ERROR: No free instances."; break;
                }
                mes " ";
                mes "Instance creation ^FF0000failed^000000.";
                emotion ET_HUK;
                close;
            }
            mes "[Sample Instance]";
            mes "Instance created.";
            mes " ";
            mes "Now entering the instance...";
            next;
            break;
        case 2:
            mes "[Sample Instance]";
            mes "Okay. Maybe next time!";
            close;
        }
    }
    .@enter = instance_enter(.@instance$);
    if (.@enter != 0) {
        mes "[Sample Instance]";
        switch (.@enter) {
            case 1: mes "ERROR: Party not found."; break;
            case 2: mes "ERROR: Party does not have an instance."; break;
            case 3: mes "ERROR: Unknown error."; break;
        }
        mes " ";
        mes "Instance entry ^FF0000failed^000000.";
        emotion ET_HUK;
        close;
    }
    close;
}

// Instance Scripts
//============================================================
abyss_03,154,159,6    script    Instance NPC#start    101,{
    mes "[Instance NPC]";
    mes "Are you ready to begin?";
    next;
    switch(select("Yes.:No.")) {
    case 1:
        mes "[Instance NPC]";
        mes "Good luck.";
        close2;
        donpcevent instance_npcname("#ins_abyss03_mobs")+"::OnEnable";
        delwaitingroom;
        disablenpc instance_npcname(strnpcinfo(0));
        end;
    case 2:
        mes "[Instance NPC]";
        mes "Take your time.";
        close;
    }
    end;

OnInit:  // hide the NPC on the normal map
    disablenpc strnpcinfo(0);
    end;
OnInstanceInit:  // initialize the NPC when the instance is created
    disablenpc instance_npcname("abysslakedunwarp004");  // disable original warp portal (currently buggy)
    waitingroom "Click here to start!",0;
    end;
}

abyss_03,0,0,0    script    #ins_abyss03_mobs    -1,{
    end;
OnEnable:
    initnpctimer;
    end;
OnTimer1000:  //strnpcinfo(4) will retrieve the instanced map name
    mapannounce strnpcinfo(4),"Instance NPC: The Abyss Lake instance has begun.",bc_all;
    end;
OnTimer4000:
    mapannounce strnpcinfo(4),"Instance NPC: Smash the Treasure Chest in the center of the map for a prize.",bc_all;
    end;
OnTimer5000:
    stopnpctimer;

    // spawn mobs
    .@map$        = instance_mapname("abyss_03");
    .@label$      = instance_npcname(strnpcinfo(0))+"::OnMyMobDead";
    .@label_boss$ = instance_npcname(strnpcinfo(0))+"::OnMyBossDead";
    monster .@map$,0,0,"Huge Poring",1002,20,.@label$,2;
    monster .@map$,0,0,"Huge Drops",1113,15,.@label$,2;
    monster .@map$,0,0,"Huge Poporing",1031,10,.@label$,2;
    monster .@map$,0,0,"Huge Marin",1242,10,.@label$,2;
    monster .@map$,0,0,"Tiny Zombie",1015,30,.@label$,1;
    monster .@map$,0,0,"Huge Mime Monkey",1585,2,.@label$,2;
    monster .@map$,97,102,"Treasure Chest",1732,1,.@label_boss$,2;
    end;
OnMyMobDead:  // normal mobs
    dispbottom "What am I doing? I should be attacking the Treasure Chest!";
    viewpoint 0,97,102,0,0xFF0000;
    switch (rand(6)) {  // for fun (:
        case 0: sc_start SC_STONE,5000,0; break;
        case 1: sc_start SC_FREEZE,5000,0; break;
        case 2: sc_start SC_STUN,5000,0; break;
        case 3: sc_start SC_SLEEP,5000,0; break;
        case 4: sc_start SC_CONFUSION,5000,0; break;
        case 5: sc_start SC_BLIND,5000,0; break;
    }
    end;
OnMyBossDead:  // treasure chest
    specialeffect2 EF_MVP;
    getitem 512,1; //Apple

    // trigger other events
    .@map$   = instance_mapname("abyss_03");
    .@label$ = instance_npcname(strnpcinfo(0))+"::OnMyMobDead";
    killmonster .@map$,.@label$;
    mapannounce .@map$,"Instance NPC: Good work! Please speak to me as soon as possible.",bc_all;
    donpcevent instance_npcname("Instance NPC#finish")+"::OnEnable";
    end;
}

abyss_03,97,102,4    script    Instance NPC#finish    101,{
    mes "[Instance NPC]";
    mes "Congratulations! You've finished the instance.";
    mes "I'll send you back to town now.";
    emotion ET_BEST;
    close2;
    warp "prontera",156,191;
    instance_destroy();
    end;

OnInit:
    disablenpc strnpcinfo(0);
    end;
OnInstanceInit:
    disablenpc instance_npcname(strnpcinfo(0));
    end;
OnEnable:
    enablenpc instance_npcname(strnpcinfo(0));
    specialeffect EF_HIDING;
    end;
}

abyss_03,115,26,0    script    #ins_abyss03_warp    45,5,5,{
    end;
OnTouch:
    mes "Are you sure you want to leave?";
    next;
    switch(select("Leave.:Stay.")) {
    case 1:
        warp "prontera",156,191;
        break;
    case 2:
        warp strnpcinfo(4),160,155;
        break;
    }
    close;
OnInit:
    disablenpc strnpcinfo(0);
    end;
}

 

Edited by Archetype Saber
many lol
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   1
  • Joined:  12/22/15
  • Last Seen:  

I liked this instance, I found it simpler to work with.
But I'm having trouble executing some instance commands. I want to kill 10 monsters, then an mvp appears and when he is dead a portal to the next level would appear. I did a mining system using these commands below, I tried to do the same with this instance, unfortunately it did not work out.

 

set $mobs,$mobs-1;
if($mobs == 1){$mobs  = 1; monster "1@eom",56,91,"Faceworm Queen",2534,1,"DS3::Ondsdead";}
if($mobs == 0){$mobs  = 0; enablenpc "WarpPortal#1";}
 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   1
  • Joined:  12/22/15
  • Last Seen:  

what would be an ideal for instance?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  91
  • Reputation:   22
  • Joined:  10/24/14
  • Last Seen:  

Here is some help,

Create an event NPC where you manage your normal monsters (sample below).

Attach OnMobDead event on every minion and after minions have been killed activate boss event NPC.

prt_are01,0,0,-1	script	SummonMinions#1_1	-1,{
	end;

OnInit: // disable NPC on normal map
	disablenpc strnpcinfo(0);
	end;

OnDisable: // Disable this NPC
	disablenpc instance_npcname(strnpcinfo(0));
	end;

OnEnable:
	enablenpc instance_npcname(strnpcinfo(0));
	.@map$ = instance_mapname("prt_are01");
	.@label$ = instance_npcname(strnpcinfo(0))+"::OnMobDead";
	// Monsters
	areamonster .@map$,131,168,144,155,"Marin",1242,5,.@label$; //top-left
	areamonster .@map$,155,167,168,155,"Metaling",1613,5,.@label$; //top-right
	areamonster .@map$,144,155,144,131,"Poporing",1031,5,.@label$; //bottom-left
	areamonster .@map$,155,144,168,131,"Drops",1113,5,.@label$; //bottom-right
	end;

OnMobDead:
	if (mobcount(instance_mapname("prt_are01"), instance_npcname(strnpcinfo(0))+"::OnMobDead") < 1) {
		mapannounce instance_mapname("prt_are01"),"Boss incomming!",bc_map,"0xFD3B02";
		donpcevent instance_npcname("SummonBoss#1_1")+"::OnEnable";
		disablenpc instance_npcname(strnpcinfo(0)); //Disable this NPC.
	}
	end;
}

Create an event NPC for the boss monster (Sample below).

prt_are01,150,150,-1	script	SummonBoss#1_1	-1,{
	end;

OnInit: // Disable NPC on normal map
	disablenpc strnpcinfo(0);
	end;

OnEnable:
	enablenpc instance_npcname(strnpcinfo(0));
	.@map$ = instance_mapname("prt_are01");
	.@label$ = instance_npcname(strnpcinfo(0))+"::OnBossDead";
	// Monsters
	monster	.@map$,150,150,"The Boss",1090,1,.@label$;
	end;

OnDisable: // Disable this NPC
	disablenpc instance_npcname(strnpcinfo(0));
	end;

OnBossDead:
	//specialeffect2 EF_MVP; //This effect will be triggered on the player who dealt the killing blow.
	mapannounce instance_mapname("prt_are01"),"Boss is dead!",bc_map,"0xFD3B02";
	killmonster instance_mapname("prt_are01"),instance_npcname(strnpcinfo(0))+"::OnBossDead"; //Clean up

	// Enable portal npc at the center of the room.
	donpcevent instance_npcname("#PortalOut")+"::OnEnable";

	// Disable this NPC
	//donpcevent instance_npcname(strnpcinfo(0))+"::OnDisable";
	disablenpc instance_npcname(strnpcinfo(0));

	end;
}

After boss dies you activate portal event NPC (Sample below).

prt_are01,150,150,0	script	#PortalOut	WARPNPC,2,2,{
	end;

OnInit: // Disable NPC on normal map
	disablenpc strnpcinfo(0);
	end;

OnInstanceInit: // Disable NPC on instance init
	disablenpc instance_npcname(strnpcinfo(0));
	end;

OnEnable:
	mapannounce instance_mapname("prt_are01"),"[Portal] The portal to out side will be opening at the center of the room.",bc_map,"0x7799ff";
	initnpctimer; // Activate portal after 10 seconds
	end;

OnDisable:
	stopnpctimer;
	disablenpc instance_npcname(strnpcinfo(0));
	end;

OnTimer10000:
	mapannounce instance_mapname("prt_are01"),"[Portal] The portal to out side is now open.",bc_map,"0x7799ff";
	enablenpc instance_npcname(strnpcinfo(0));
	stopnpctimer;
	end;

OnTouch:
	warp "prontera", 156, 167;
	end;
}

Repeat this process for each level you wish to create.

Good luck! ;)

Edited by Sehrentos
Addition
  • Upvote 1
  • Like 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   1
  • Joined:  12/22/15
  • Last Seen:  

Thank you my friend!
You were able to help me with something I've been trying for months.
I bid you and the Rathena team.
Thank you!

  • Like 1
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...