Jump to content

Zell

Members
  • Posts

    412
  • Joined

  • Last visited

  • Days Won

    28

Posts posted by Zell

  1. On 3/22/2024 at 2:50 AM, playniks said:

    Hello! Thank you so much for this great concept. This is truly a very useful mod and a content to my server.
    I was able to have it work as stackable item, but how do we apply the item script even when the items are stacking?

    So my itemscript is "bonus bStr,100;" .  so If I have 5 pcs charm item stacking on my inventory it should give me 500 str, but it only count 5pcs charm item as one thus giving me only str+100.

    So even if I have 5pcs charm item stacking on my inventory, How do we make it give Str +500?


    bonus bStr,countitem(<id>)*100;

  2. mes "Hit 'Cancel' Buton";
    
    switch(prompt("Bla bla", "blu blu", "Cancel"))
    {
    	case 1:
    		mes "Blabla";
    		close;
    
    	case 2:
    		mes "BluBlu";
    		close;
    
    	case 255:
    		mes "Cancel button clicked!";
    	case 3:
    		mes "Cancel";
    		close;
    }


     

    *select("<option>"{,"<option>",...})
      *prompt("<option>"{,"<option>",...})
       
      This function is a handy replacement for 'menu' for some specific cases where
      you don't want a complex label structure - like, for example, asking simple yes-
      no questions. It will return the number of menu option picked, starting with 1.
      Like 'menu', it will also set the variable @menu to contain the option the user
      picked.
       
      if (select("Yes:No" ) == 1)
      mes "You said yes, I know.";
       
      And like 'menu', the selected option is consistent with grouped options
      and empty options.
       
      'prompt' works almost the same as select, except that when a character clicks
      the Cancel button, this function will return 255 instead.

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

  5. 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;
    }
    
  6. 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 .@test 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 .@test is \" + .@test;         " +
                "next;                                         " +
                ".@test = rand(200, 500);                      " +
                "mes \"Now value of .@test will be \" + .@test;" +
                "close2;                                       " );
    
        mes "[Inject Code End]", " ";
        mes "Inject was ok and .@test is now " + .@test;
        close;
    }

     


     

    • Upvote 4
    • Love 2
    • MVP 1
  7. 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
  8. [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
  9. It's not already time to implement a foreach?

    for( .@i = 0; .@i < getarraysize(.@array); .@i++)
    {
       dispbotom "Val is " + .@array[.@i];
    }


    We could use:

    foreach( .@val : .@array )
    {
       dispbottom "Val is " + .@val;
    }

    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 6
    • Like 1
  10. 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

×
×
  • Create New...