Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Share Posted November 9, 2012 zhakastia,104,68,5 script PvP Warper 413, { //PvP Warper mes "[ ^000088PvP Arena Warper^000000 ]"; mes "Would you like to go to the PVP Arena"; next; switch(select("Arena 1 (Dipel)","Abort")) { case 1: warp "guild_vs3",0,0; close; case 2: function script dispell { while ( .@STATUS < 297 ) { if ( .@STATUS != SC_WEIGHT50 && .@STATUS != SC_WEIGHT90 && .@STATUS != SC_NOCHAT && .@STATUS != SC_XMAS && .@STATUS != SC_SUMMER && .@STATUS != SC_JAILED ) sc_end .@STATUS; set .@STATUS, .@STATUS+1; } return; } close; } } Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 9, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 17 hours ago Share Posted November 9, 2012 http://pastebin.com/raw.php?i=nLZYu9Tj the "dispell" function that can be access by any NPC...because it's declared globally... or http://pastebin.com/raw.php?i=13hhxUdp the "dispell" function that can only be access by this NPC...because it's not declared globally...but declared inside the npc only. Quote Link to comment Share on other sites More sharing options...
Mootie Posted November 9, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 815 Reputation: 86 Joined: 10/26/12 Last Seen: June 10, 2022 Author Share Posted November 9, 2012 (edited) http://pastebin.com/raw.php?i=nLZYu9Tj the "dispell" function that can be access by any NPC...because it's declared globally... or http://pastebin.com/raw.php?i=13hhxUdp the "dispell" function that can only be access by this NPC...because it's not declared globally...but declared inside the npc only. thank you for correcting me i was searching for normal refiner like if the weapon/armor is +4 it has chance to be broke Edited November 9, 2012 by Mootie Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 Just to know, can you really script a function inside a switch case? O.o New feature of rA? xD Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 9, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 17 hours ago Share Posted November 9, 2012 @Ryokem as you can see inside the script.. the function is defined inside the NPC....thus...it will only work on this npc... and with rAthena improvement... you can simply call a function like this.. // rAthena dispell(); // eAthena callfunc "displell"; you can call the function as long as it's declared somewhere in or outside of the script before it's executed... Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 @Ryokem as you can see inside the script.. the function is defined inside the NPC....thus...it will only work on this npc... and with rAthena improvement... you can simply call a function like this.. // rAthena dispell(); // eAthena callfunc "displell"; you can call the function as long as it's declared somewhere in or outside of the script before it's executed... Yeh, I know imperative languages pretty well But that was not what I was aking for. function dispell(); //<-- Initialization on dispell function dispell(); //<-- function call What I mean is, can you really define the function script inside another one? <header>,{ function script <name> { //function features } } Does this work on rAthena? If you check on C, C++, Java or similar, each function must be declared not in another one, even if each function can call another one. That was what I was looking at, to learn if it's possible to or it is just a weird error. Quote Link to comment Share on other sites More sharing options...
Emistry Posted November 9, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 17 hours ago Share Posted November 9, 2012 when you create a function outside a npc....... it will look like this.. if it's inside the npc.....it will look like this... there are different between the funtion's "header" that create in / outside of npc... Quote Link to comment Share on other sites More sharing options...
Ryokem Posted November 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 205 Reputation: 19 Joined: 10/12/12 Last Seen: November 7, 2013 Share Posted November 9, 2012 when you create a function outside a npc....... it will look like this.. if it's inside the npc.....it will look like this... there are different between the funtion's "header" that create in / outside of npc... Uh, ok I got it, something such as an @override or @overload... I've always said it, there's always something new to learn! Arigatou! Quote Link to comment Share on other sites More sharing options...
Question
Mootie
Link to comment
Share on other sites
7 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.