Auryn Posted August 9, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 147 Reputation: 1 Joined: 01/26/12 Last Seen: April 27, 2018 Share Posted August 9, 2012 (edited) Here is the councerned part of the script. I would like the player get a chance to die with the final heal -100,+0; . But when I try dying during the script, I get stuck and when i try do add a break; , I get an error. mes "[Antitée]"; mes "Laisse nous evaluer tes forces."; skilleffect 812,5000; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; // repeating x100 percentheal -1, -1; heal -100,+0; next; mes "[Antitée]"; mes "Très bien."; next; mes "[Antitée]"; mes "A présent, nous allons te poser quelques questions."; next; [...] Edit : I have a secound question : Can I make the script continue out of the NPC ? Like : mes "[Antitée]"; mes "Laisse nous evaluer tes forces."; close; // keep going skilleffect 812,5000; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; sleep2 50; percentheal -1, -1; Edited August 9, 2012 by Auryn Quote Link to comment Share on other sites More sharing options...
EvilPuncker Posted August 9, 2012 Group: Members Topic Count: 19 Topics Per Day: 0.00 Content Count: 713 Reputation: 71 Joined: 11/08/11 Last Seen: December 25, 2024 Share Posted August 9, 2012 close2; // keep going Quote Link to comment Share on other sites More sharing options...
Mystery Posted August 9, 2012 Group: Members Topic Count: 94 Topics Per Day: 0.02 Content Count: 2192 Reputation: 253 Joined: 11/11/11 Last Seen: June 24, 2020 Share Posted August 9, 2012 close2; // keep going Edit : I have a secound question : Can I make the script continue out of the NPC ? To elaborate on what close2; is supposed to do: ---------------------------------------*close2; This command will create a 'close' button in the message window for the invoking character. WARNING: If no window is currently on screen, the script execution will halt indefinitely! See 'close'. There is one important difference, though - even though the message box will have closed, the script execution will not stop, and commands after 'close2' will still run, meaning an 'end' has to be used to stop the script, unless you make it stop in some other manner. mes "[Woman]"; mes "I will warp you now"; close2; warp "place",50,50; end; Don't expect things to run smoothly if you don't make your scripts 'end'. --------------------------------------- And then the use of end; on why you need it after using close2; *end;This command will stop the execution for this particular script. The two versions are perfectly equivalent. It is the normal way to end a script which does not use 'mes'. if (BaseLevel<=10) goto L_Lvl10; if (BaseLevel<=20) goto L_Lvl20; if (BaseLevel<=30) goto L_Lvl30; if (BaseLevel<=40) goto L_Lvl40; if (BaseLevel<=50) goto L_Lvl50; if (BaseLevel<=60) goto L_Lvl60; if (BaseLevel<=70) goto L_Lvl70; L_Lvl10: npctalk "Look at that you are still a n00b"; end; L_Lvl20: npctalk "Look at that you are getting better, but still a n00b"; end; L_Lvl30: npctalk "Look at that you are getting there, you are almost 2nd profession now right???"; end; L_Lvl40: npctalk "Look at that you are almost 2nd profession"; end; Without the use if 'end' it would travel through the labels until the end of the script. If you were lvl 10 or less, you would see all the speech lines, the use of 'end' stops this, and ends the script. -------------------------------------- https://rathena.svn.sourceforge.net/svnroot/rathena/trunk/doc/script_commands.txt Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 9, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 21 hours ago Share Posted August 9, 2012 try this close2; while( HP > 1 ){ percentheal -1,-1; sleep2 50; } percentheal -100,-100; end; 2 Quote Link to comment Share on other sites More sharing options...
Auryn Posted August 9, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 147 Reputation: 1 Joined: 01/26/12 Last Seen: April 27, 2018 Author Share Posted August 9, 2012 (edited) Thanks you all for your help, and thank you emistry for this exemple. I have one more questions to add : How can I temporary desactivate the teleport skill / use of fly wings/butterfly wings ? Edited August 9, 2012 by Auryn Quote Link to comment Share on other sites More sharing options...
Aleos Posted August 9, 2012 Group: Development Manager Topic Count: 56 Topics Per Day: 0.01 Content Count: 732 Reputation: 525 Joined: 12/13/11 Last Seen: June 13, 2024 Share Posted August 9, 2012 (edited) A dirty quick way, add this: map[i].noteleport = 1; // disallow teleport map[i].noreturn = 1; // disallow returns Add that in map_flags_init() in src/map/map.c after the jexp mapflag. This will disallow teleporting and returns on every single map on server load. Remember to recompile! Edited August 9, 2012 by Aleos Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 9, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 21 hours ago Share Posted August 9, 2012 there is setmapflag and removemapflag Quote Link to comment Share on other sites More sharing options...
Question
Auryn
Here is the councerned part of the script.
I would like the player get a chance to die with the final
.
But when I try dying during the script, I get stuck and when i try do add a
, I get an error.
[...]
Edit : I have a secound question :
Can I make the script continue out of the NPC ?
Like :
Edited by AurynLink to comment
Share on other sites
6 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.