Jump to content
  • 0

My First self Script


Question

Posted
 

Hi Guys,
I need your help. This is my first self-made NPC, the kill counter works and you can also submit the quest, but he writes the messages all one after the other although he should do it in different message boxes.

can someone please help me and explain what I'm doing wrong.

chry_fld,62,73,4	script	Uppe	894,{
mes "Hallo ich bin Uppe.";
mes "Ich brauche deine Hilfe!";
mes "Kannst du bitte 10 Poringe besiegen.";
mes "Ich gebe dir auch eine kleine Belohnung.";
next;
mes "Danke das du 10 Poringe besiegt hast.";
mes "Hier ist deine Belohnung.";
mes "Kannst du mir noch einen Gefallen tun?";
mes "Solltest du nach Prontera reisen, kannst du meinen Bruder Ornn besuchen";
mes "Er hat bestimmt weitere Missionen, wo du ihm helfen kannst.";
next;
if(PoringKills < 10) goto l_nokills;
set PoringKills,PoringKills - 10;
	getitem 569,400;
	getexp 500,300;
	close;
l_nokills:
mes "Du hast noch keine 10 Poringe besiegt.!";
mes "Komm wieder wenn du sie besiegt hast.!";
close;
OnNPCKillEvent:
if(killedrid == 1002) //1002 = Poring
{
set PoringKills,PoringKills + 1;
}
close;
end;
OnInit:
	waitingroom "Novice Mission",0;
	end;
}
}

 

3 answers to this question

Recommended Posts

  • 0
Posted

What do you mean by "writes the messages all one after the other although he should do it in different message boxes"?

What I understand is that you want every "mes" to be a different window, but I don't think that's what it is.

  • 0
Posted (edited)

I can't understand . If im not mistaken your script have error because there is a double curly at the end of the script

Edited by Poring King
  • 0
Posted (edited)

Just change
 

mes "Er hat bestimmt weitere Missionen, wo du ihm helfen kannst.";next;if(PoringKills < 10) goto l_nokills;set PoringKills,PoringKills - 10;	getitem 569,400;	getexp 500,300;	close;l_nokills:mes "Du hast noch keine 10 Poringe besiegt.!";
	



to

mes "Er hat bestimmt weitere Missionen, wo du ihm helfen kannst.";
if(PoringKills < 10) goto l_nokills;
set PoringKills,PoringKills - 10;
	getitem 569,400;
	getexp 500,300;
	close;
l_nokills:
next;
mes "Du hast noch keine 10 Poringe besiegt.!";

 

And here is your script refactored for learning purpose:
 

 
chry_fld,62,73,4    script    Uppe    894,{
    
    mes "Hallo ich bin Uppe.";
    mes "Ich brauche deine Hilfe!";
    mes "Kannst du bitte 10 Poringe besiegen.";
    mes "Ich gebe dir auch eine kleine Belohnung.";
    next;
    mes "Danke das du 10 Poringe besiegt hast.";
    mes "Hier ist deine Belohnung.";
    mes "Kannst du mir noch einen Gefallen tun?";
    mes "Solltest du nach Prontera reisen, kannst du meinen Bruder Ornn besuchen";
    mes "Er hat bestimmt weitere Missionen, wo du ihm helfen kannst.";

	if( PoringKills == 10 )
    {
		PoringKills = 0;
        getitem 569,400;
        getexp 500,300;
    }
    else
    {
        next;
        mes "Du hast noch keine 10 Poringe besiegt.!";
        mes "Komm wieder wenn du sie besiegt hast.!";
    }
    
    close;
    
    OnNPCKillEvent:
        if( killedrid == 1002 && PoringKills < 10 )
            PoringKills++;
        end;
	
    OnInit:
        waitingroom "Novice Mission",0;
        end;
}
Edited by Zell

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...