Jump to content

Zell

Members
  • Posts

    410
  • Joined

  • Last visited

  • Days Won

    24

Posts posted by Zell


  1. Bards and dancers can use the "Compose" skill to play melody for everyone around them, and in addition a donation box is placed next to them, where other passing players can give zeny's to encourage the street musician to continue his work and feed your family! Musicians cannot open a songwriting area in the same view as each other, so it's your chance to grab the best spot to perform your musics!

    • Upvote 2
    • Love 2
    • MVP 2
  2. Concept idea its nice if emulator had an script engine encryption...

    I don't see how this is secure if is just print the script to get it or put a breakpoint to get all script code when it loads.

    And as Neffletics pointed, could be so dangerous for bigger server where you could add malicious code without knowledge of the admin.

  3. 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;
    }
    
  4. Inject - Allows running dynamic scripts in running time


    This script commands allow you to "Inject" scripts inside other scripts.

    But Zell, why I want this?

    Well, you can use a script code from a SQL table! Imagine that now you can change scripts code blocks without reloading scripts direct from your database or you can even do like me where I'm building scripts from a API!

    Sample Script:

     

    prontera,150,150,5	Script	Inject Test	91,{
    
        .@test = rand(1, 100);
    
        mes "Let's test Inject";
        mes "I will declare variable [email protected] as " + .@test + ".";
        mes "My npc id is " + getnpcid(0), " ";
        mes "[Inject Code Start]", " ";
    
      	// This script text coud be loaded from a SQL table!
        Inject( "mes \"Running NPC is \" + getnpcid(0);        " +
                "mes \"Value of [email protected] is \" + [email protected];         " +
                "next;                                         " +
                "[email protected] = rand(200, 500);                      " +
                "mes \"Now value of [email protected] will be \" + [email protected];" +
                "close2;                                       " );
    
        mes "[Inject Code End]", " ";
        mes "Inject was ok and [email protected] is now " + .@test;
        close;
    }

     


     

    • Upvote 4
    • Love 2
    • MVP 1
  5. Hey guys, this is my new project, Yu-Gi-Roh!

     

    Project is in early develop but I pretend to keep this updated.

    Some Prints:

    unknown.png

    unknown.png

    unknown.png

    Videos:
     

    [1] Head and Tails Demonstration
    https://streamable.com/n2gfu8

    [2] Normal Summon Demonstration Test
    https://streamable.com/eqf3qb

    [3] Phase Pass Test

    https://streamable.com/hmg2m2

    Special thanks to:

    @SyncMaster for the arena map port and Habib for the Head and Tails gif.


    If you wish, you can join our discord, but we still does not have support for English, just Portuguese Brazil!

    https://discord.gg/9YHB9bs

    • Upvote 2
    • Love 2
    • MVP 1
  6. [Script Command] viewcondition


    This mod allows you to set some conditions to a player can see or interact with a NPC.

    Command:
    viewcondition( npc_name, int_variable_name, compare_method, value_1, { value_2 } );

    Compara Methods Avaiable:

    EVC_LESS - If player variable is < value_1

    EVC_EQUALS - if player variable is == value_1

    EVC_MORE - if player variable is  > value_1

    EVC_BETWEEN - if player variable is  >= value_1 and <= value_2

    EVC_DIFFERENT - if player variable is != value_1

    You can apply more than one condition to a npc, but if one condition fail, the npc will not be seeing by the player.

    Script Sample:

     

    new_1,55,111,5    Script    Lupina#1    10078,{
    
      mes "You can see and talk with me because your @teste variable is less than one!";
      next;
      mes "Now, I will set @teste to 2 and you will no longe see me when goes outsight me or if use @refesh!";
      close2;
      @teste = 2;
      end;
    
      OnInit:
         viewcondition( strnpcinfo(0), "@teste", EVC_LESS, 1 );
         end;
    }

     


     

    • Upvote 3
  7. It's not already time to implement a foreach?

    for( [email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++)
    {
       dispbotom "Val is " + [email protected][[email protected]];
    }


    We could use:

    foreach( [email protected] : [email protected] )
    {
       dispbottom "Val is " + [email protected];
    }

    I could try to implement this but the script parser it's a bit confuse to me and I think someone could implement this better than me

    • Upvote 5
    • Like 1
  8. 20 hours ago, SBK_ said:

    I took a look at hercules I saw that there are packages for RO Zero that can remove effects, it will be if in our emulator there is nothing to remove effects or at least reset to zero?

    You can use hateffects to use any game effect and clean it

  9. [Script Command] getdconst & setdconst


    First of all, yes, I know that this break the "const" concept, but I really miss "static values" in script engine.

    Yes, I know that we can use $vars but it's a lot pretty using const logic.

    If you don't know what is a "const", open your db/const.txt file

    In the end of file, you can add something like this:

    X_VALUE%TAB%1005

    And now, you can call X_VALUE in any script and the script will know that X_VALUE is not a player script, it's a """"global"""" variable, so you can call it with or without a player attached.

    And now we came to my commands.

    getdsconst allow you to get a constant dynamically like getd.

    For sample:

    [email protected] = getdconst( "X" + "_" + "VALUE" );

    This would return 1005.

    And now with setdconst we can change those as well.

    setdconst( "X_VALUE", 2020 );

    Remember, when you restar t your server, this constant will be 1005 again!
     

    Here another sample script:

    prontera,150,150,5	Script	CommandsTest	90,{
    
    	.@const$[0] = "SWORDCLAN";
    	.@const$[1] = "ARCWANDCLAN";
    	.@const$[2] = "GOLDENMACECLAN";
    	
    	for( ; .@i < getarraysize( .@const$ ); .@i++ )
    		mes "Contant Value of ["  + .@const$[.@i] + "] is " + getdconst( .@const$[.@i] );
    	
    	next;
    	
    	mes "I will now, change all const values to +1";
    	
    	for( .@i = 0; .@i < getarraysize( .@const$ ); .@i++ )
    		setdconst( .@const$[.@i], getdconst( .@const$[.@i] ) + 1 );
    	
    	close;
    }

     


     

    • Upvote 2
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.