Jump to content

PsyOps

Members
  • Posts

    150
  • Joined

  • Last visited

Posts posted by PsyOps

  1. On 9/10/2018 at 3:34 AM, ArchAngell said:

    I inserted the script into my test server and got 2 problems:

    - The prize is collected before the online time (default as 60 minutes);

    - The remaining time to collect the prize get bugged (seen in image);

    Does anyone have any ideas of what could cause this?

    daily error.jpg

    Encountered the same problem. Also there is an error

    [Error]: buildin_sleep: negative or zero amount('-1057747196') of milli seconds is not supported
    [Debug]: Source (NPC): LOGIN (invisible/not on a map)

    Any thoughts to this?

  2. On 8/5/2017 at 1:04 PM, sotf said:

    Try:

    
    function	script	specialbox {
    	setarray .i1[0],909,910; // Common Items
    	set .i1rand,rand(0,1); // Randomize Common Items; just change max amount if you add items
    	setarray .i2[0],911,912; // Rare Items
    	set .i2rand,rand(0,1); // Randomize Rare Items; just change max amount if you add items
    	setarray .i3[0],2199,1599; // Super Rare Items
    	set .i3rand,rand(0,1); //Randomize Super Rare Items; just change max amount if you add items
    	set .chance, rand(100);
    
    		// Super Rare Item 1%
    		if (.chance == 1){
    		getitem .i[.i3rand],1;
    		announce "["+strcharinfo(0)+"] won a ["+getitemname(.i[.i3rand])+"] from the Special Box.",0;
    		end;
    		} 
    
    		// Rare Item 10%
    		else if (.chance <= 2 && .chance >= 11){
    		getitem .i[.i2rand],1;
    		announce "["+strcharinfo(0)+"] won a ["+getitemname(.i[.i2rand])+"] from the Special Box.",0;
    		end;
    		} 
    
    		// Common Items
    		else {
    		getitem .i1[.i1rand],1;
    		end; }
    }

    Just add items in .i1, .i2 and .i3 arrays and make sure to change the variables that randomizes the items to the max number of item you included -1. (-1 since arrays start with 0).

    I need to ask if this is working on the latest rathena? - Solved it works.

    I need to ask why it said " Player won a [null] from the Special Box. "

     

  3. 13 hours ago, OscarScorp said:

    Wait, I got mine working. I... didn't do anything, it just started working.
    Test your items:

    
    50007,Campfire,Campfire,0,200,50,250,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc("func_CreateCampFire", 4, 40, 1); },{},{} //<range>, <duration>, <heal_rate>;
    902,Tree_Root,Tree Root,0,12,,10,,,,,0xFFFFFFFF,63,2,,,,,,{ callfunc("func_UpdateCampFire", 0, 2, 0); },{},{} //Modified item, now usable.

    Revise the code provided by Emistry, or even if you need to, re-do the whole instalation process.

    I will try and use what you have here, giving you feedback soon on this. ?

  4. 4 hours ago, OscarScorp said:

    Error in new rAthena:

    
    In file included from script.cpp:24074:
    ../custom/script.inc: In function 'int buildin_duplicatenpc(script_state*)':
    ../custom/script.inc:86:11: warning: 'char* strncat(char*, const char*, size_t)' specified bound 1 equals source length [-Wstringop-overflow=]
        strncat(new_npc_name, "#", 1);
        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
    ../custom/script.inc:87:11: warning: 'char* strncat(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Wstringop-overflow=]
        strncat(new_npc_name, new_hidden_name, strlen(new_hidden_name));
        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Cannot use Campfire function in the newest rAthena /sob item won't do anything (It worked perfectly for me before updating rAthena).

    That is what i've figured. Maybe you will need an rAthena that is at least back November of 2018

     

  5. On 3/28/2019 at 4:44 PM, Emistry said:

    find the defailt NPC Sprite ID 10252 and replace it with whatever npc sprite you want.

    Thanks for the reply Emistry. Awesome as always.

    I tried to add the campfire to a new rathena. It did not work for me. No errors on recompiling. Also added the functions and itemdb changes.
    To no avail, when i click the matchstick, does not do anything.

    Any thoughts where i went wrong?

    • Upvote 1
  6. On 3/24/2019 at 11:55 PM, behemothcze said:

    can you post your script

    prontera,140,151,3    script    Vending Helper#1    757,{
    for( set .@i,1; .@i <= .count; set .@i,.@i + 1 ){
        getmapxy( .@map$,.@x,.@y,1,"#vend_slot"+.@i );
        if( !getareausers( .map$,.@x,.@y,.@x,.@y ) && .@x > 1 && .@y > 1 ){
            set .@available,.@available + 1;
            set .@menu$,.@menu$ + "Slot - "+.@i+":";
        }else{
            set .@menu$,.@menu$ + ":";
        }
    }
    
    if( !.@available ){
        mes "Dont have any available slot.";
    }else if( !getskilllv("MC_VENDING") ){
        mes "You dont have ^0055FFVending Skill^000000.";
    }else{
        mes "Available Slot : "+.@available;
        mes "Please select a slot to vending.";
        set .@i,select( .@menu$ );
        getmapxy( .@map$,.@x,.@y,1,"#vend_slot"+.@i );
        if( .@x == 1 || .@y == 1 ){
            mes "This NPC at invalid location...";
        }else{
            warp .@map$,.@x,.@y;
            hideonnpc "#vend_slot"+.@i;
        }
    }
    close;
    
    OnInit:
    sleep 1000;
    // Map for vending
    set .map$,"prontera";
    setcell .map$,0,0,300,300,cell_novending,1;
    
    // x and y horizone ..
    setarray .x_line,148,151,154,157,160,163;
    setarray .y_line,155,152,149,146,143,140;
    
    set .x_line_size,getarraysize( .x_line );
    set .y_line_size,getarraysize( .y_line );
    set .count,1;
    for( set .@x,0; .@x < .x_line_size; set .@x,.@x + 1 )
        for( set .@y,0; .@y < .y_line_size; set .@y,.@y + 1 )
            if( checkcell( .map$,.x_line[.@x],.y_line[.@y],cell_chkpass ) ){
                movenpc "#vend_slot"+.count,.x_line[.@x],.y_line[.@y];
                setcell .map$,.x_line[.@x],.y_line[.@y],.x_line[.@x],.y_line[.@y],cell_novending,0;
                set .count,.count + 1;
            }
    npctalk "Vending Spot : "+.count;
    donpcevent "::OnSetup";
    end;
    }
    
    -    script    vend_slot    -1,{
    getmapxy( .@map$,.@x,.@y,1 );
    if( !getskilllv("MC_VENDING") ){
        mes "You dont have ^0055FFVending Skill^000000.";
    }else if( getareausers( .@map$,.@x,.@y,.@x,.@y ) ){
        mes "Someone already selected this spot.";
    }else{
        mes "Spot : ^777777Available^000000";
        mes "^0055FF[ Vending Area Rules ]^000000";
        mes "^FF0000 ~ Use proper Shop Name.^000000";
        mes "^FF0000 ~ Never sell Junk/Gifts.^000000";
        mes " ";
        mes "^777777Player will failed to follow these will be punished.^000000";
        if( select( "Select this Spot","Cancel" ) == 1 ){
            warp .@map$,.@x,.@y;
            hideonnpc strnpcinfo(0);
        }
    }
    close;
    
    OnSetup:
    getmapxy( .@map$,.@x,.@y,1 );
    set .@npcname$,strnpcinfo(0);
    while( .@map$ != "" ){
        if( getareausers( .@map$,.@x,.@y,.@x,.@y ) ){
            hideonnpc .@npcname$;
        }else{
            hideoffnpc .@npcname$;
            // specialeffect 313;
        }
        sleep 5000;
    }
    end;
    }
    
    // Add more if needed.
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot1    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot2    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot3    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot4    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot5    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot6    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot7    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot8    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot9    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot10    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot11    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot12    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot13    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot14    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot15    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot16    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot17    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot18    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot19    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot20    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot21    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot22    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot23    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot24    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot25    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot26    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot27    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot28    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot29    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot30    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot31    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot32    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot33    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot34    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot35    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot36    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot37    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot38    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot39    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot40    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot41    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot42    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot43    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot44    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot45    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot46    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot47    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot48    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot49    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot50    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot51    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot52    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot53    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot54    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot55    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot56    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot57    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot58    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot59    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot60    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot61    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot62    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot63    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot64    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot65    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot66    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot67    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot68    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot69    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot70    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot71    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot72    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot73    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot74    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot75    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot76    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot77    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot78    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot79    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot80    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot81    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot82    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot83    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot84    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot85    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot86    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot87    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot88    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot89    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot90    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot91    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot92    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot93    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot94    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot95    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot96    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot97    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot98    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot99    858
    prontera,1,1,4    duplicate(vend_slot)    #vend_slot100    858

     


  7. Using the latest rathena February 2019.

    Added this script. Encountered 2 types of errors

    Only changes i've made is to change the map from mellina to prontera and define the x and y coordinates.

    Any info would be greatly appreciated.

    DevG

    vend error.PNG

  8. Do we need to assign a NPC sprite id for the campfire? 

    Here:

    -    script    Camp Fire::cf_main    FAKE_NPC,{ 

    Do i need to change Campfire to 649? 

    649 is the sprite i want to use

    Also

    I added the diffs as instructed. No errors encountered with the diffs. x2 Checked if diffs are added.

    Added the scripts for each item with changing them to usable items.

    It is not working for me. I am using the latest rathena atm.

     

  9. On 3/18/2019 at 3:52 PM, iAmGnome said:

    What I understand on the above setup is that you need to have 2 VPS/Virtual Machine. 1 is for the server itself and the other 1 is for proxy.

    The proxy VPS/VM doesn't need to have a ragnarok server but only have IPTables/FirewallD configuration (as shown above) to re-route/port forward packets/traffic. Not sure of the exact term though.


    Is there like an exact guide to this?

    I understand that you need to edit this on the linux machine. 

    But do you need to configure the server and client side for the Proxy server?

     

  10. On 2/1/2018 at 11:50 AM, CrescentSaga said:

    Why would you need a proxy server?

    If I remember correctly it shouldn't be hard.
    Do you have a linux server?

    Here.
    Try to follow these steps.
    I know it wasn't very clear, but I believe with a little bit of knowledge you should be able to do it.
     

    
    #RO-Server Proxy IP Tables (Replace 0.0.0.0 with your Main Server IP & Port with Your Server Port)
    iptables-save > /etc/iptables_rules
    /sbin/iptables-restore < /etc/iptables_rules
    iptables -t nat -A PREROUTING -p tcp --dport 6900 -j DNAT --to-destination 0.0.0.0:6900
    iptables -t nat -A PREROUTING -p tcp --dport 5121 -j DNAT --to-destination 0.0.0.0:5121
    iptables -t nat -A PREROUTING -p tcp --dport 6121 -j DNAT --to-destination 0.0.0.0:6121
    iptables -t nat -A POSTROUTING -j MASQUERADE
    sysctl net.ipv4.ip_forward=1
    
    # Allow Ragnarok Online
    iptables -A INPUT -p tcp --dport 6900 -m state --state NEW -j ACCEPT
    iptables -A INPUT -p tcp --dport 5121 -m state --state NEW -j ACCEPT
    iptables -A INPUT -p tcp --dport 6121 -m state --state NEW -j ACCEPT
    
    # Have these rules take effect when iptables is started
    iptables-save

     

    After this, just change your client IP Address to the proxy server IP.

    I just want to know a few things. 
    1. Do you need to install ragnarok on the machine as well?
    2. Do you need to have that set up just on the proxy server?

  11. On 10/5/2018 at 3:20 PM, Keitenai said:

     

    in vending.cpp find this code:

    
    sprintf(message + strlen(message), "Total profit: %s x %d", "Zeny" ,(mailprofit -= mailprofit * (battle_config.vending_tax / 10000.)));

     

    change it to this:

    
    sprintf(message + strlen(message), "Total profit: %s x %d", "Zeny" ,(mailprofit -= mailprofit * (int)(battle_config.vending_tax / 10000.)));

     

    is my solution correct @Easycore ?

    had the same problem as above, it did fix the problem on visual studio but it is not now allowing me to connect to the server said "Failed to connect to server"

    "SOLVED" 
    It works but be careful with the packet version you use and change on the diff file. It needs to be the same.

    • Upvote 1
  12. On 10/5/2018 at 3:20 PM, Keitenai said:

     

    in vending.cpp find this code:

    
    sprintf(message + strlen(message), "Total profit: %s x %d", "Zeny" ,(mailprofit -= mailprofit * (battle_config.vending_tax / 10000.)));

     

    change it to this:

    
    sprintf(message + strlen(message), "Total profit: %s x %d", "Zeny" ,(mailprofit -= mailprofit * (int)(battle_config.vending_tax / 10000.)));

     

    is my solution correct @Easycore ?

    had the same problem as above, it did fix the problem on visual studio but it is not now allowing me to connect to the server said "Failed to connect to server"

×
×
  • Create New...