Jump to content
  • 0

My First self Script


Shark28

Question


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  17
  • Reputation:   2
  • Joined:  08/28/20
  • Last Seen:  

 

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

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  27
  • Reputation:   6
  • Joined:  08/01/12
  • Last Seen:  

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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

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
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  53
  • Topics Per Day:  0.01
  • Content Count:  411
  • Reputation:   261
  • Joined:  04/25/12
  • Last Seen:  

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
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...