Jump to content
  • 0

is this simple script works? im little learning


Question

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

7 answers to this question

Recommended Posts

Posted (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 by Mootie
Posted

@Ryokem

as you can see inside the script..

zkQHt.png


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

Posted

@Ryokem

as you can see inside the script..

zkQHt.png


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 :P

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.

Posted

when you create a function outside a npc.......

it will look like this..

N24nz.png

if it's inside the npc.....it will look like this...

QkKlS.png

there are different between the funtion's "header" that create in / outside of npc...

Posted

when you create a function outside a npc.......

it will look like this..

N24nz.png

if it's inside the npc.....it will look like this...

QkKlS.png

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

I've always said it, there's always something new to learn! :) Arigatou!

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