Jump to content

Patskie

Members
  • Posts

    1702
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by Patskie

  1. Change 

    if(.@card0 == 0).@card0$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]:"; else .@card0$ = getitemname(.@card0);
    if(.@card1 == 0).@card1$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]:"; else .@card1$ = getitemname(.@card1);
    if(.@card2 == 0).@card2$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]:"; else .@card2$ = getitemname(.@card2);
    if(.@card3 == 0).@card3$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]:"; else .@card3$ = getitemname(.@card3);

    To 

    if(.@card0 == 0).@card0$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]"; else .@card0$ = getitemname(.@card0);
    if(.@card1 == 0).@card1$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]"; else .@card1$ = getitemname(.@card1);
    if(.@card2 == 0).@card2$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]"; else .@card2$ = getitemname(.@card2);
    if(.@card3 == 0).@card3$ = " - [ ^D6C4E8" + "No Equip" + "^000000 ]"; else .@card3$ = getitemname(.@card3);

    It happens because when you remove the first enchant item the selection menu becomes "- [ No Equip ]:", "Enchant1", "Enchant2", "Enchant3". The script engine reads ":" as delimiter in case of select command. Since it's there all the indexes of the select options are moved [ No Equp (1), empty string (2),  card2 (3), card3 (4), card4 (5) ].

    • Upvote 2
    • Love 1
  2. Check if you pass below condition else it will go to Faltaitems label

    if( countitem(1047) < 1 || countitem(1048) < 1000) goto Faltaitems;

    Check below script

    beach_dun,270,70,4	script	Darkargol#darkalost	531,{
    	mes "Dark Argol";
    	cutin "jpn_darkalgol01",2;
    	mes "Vaya vaya, mira a aquien tenemos por aqui..";
    	mes "te puedo ayudar, pero solo si me traes un objeto unico..";
    	next;
    	cutin "jpn_darkalgol03",2;
    	mes "Dark Argol";
    	mes "Se trata de la cabeza de medusa, lamentablemente no es dropeable por ninguna de las que estan aqui!..";	
    	next;
    	cutin "jpn_darkalgol04",2;
    	mes "Dark Argol";
    	mes "Si me consigues lo siguiente:";
    	mes "1 <ITEM>Dead Medusa<INFO>1047</INFO></ITEM>.";
    	mes "1000 <ITEM>Horrendous Hair<INFO>1048</INFO></ITEM>.";
    	mes "le dare un poder nuevo al escudo que lleves equipado!.";
    	next;
    	if( countitem(1047) < 1 || countitem(1048) < 1000) goto Faltaitems;
    	cutin "jpn_darkalgol05",2;
    	mes "Dark Argol";
    	mes "Parece que tienes todos los items, deseas encantar tu escuodo equipado ya mismo?!.";	
    	next;
    	menu
    	"^0000FFEncantar Escudo^000000",shield,
    	"Cancelar",wait;
    	
    	wait:
    	cutin "jpn_darkalgol07",2;
    	mes "Dark Argol";
    	mes "Ok Ok lo comprendo.";
    	mes "Volveras con la mejor alternativa, pillin!.";	
    	close2;
    	cutin "",255;
    	end;
    	
    	shield:
    	mes "Dark Argol";
    	cutin "jpn_darkalgol01",2;
    	mes "Comenzamos.";
    	next;
    	specialeffect 96;
    	cutin "jpn_darkalgol02",2;
    	progressbar "ffff00",1;
    	if (getequipid(EQI_HAND_L) && getiteminfo(getequipid(EQI_HAND_L), 5) == 32){
    		delitem 1048,1000;
    		delitem 1047,1;	
    		set .@id, getequipid(8);
    		set .@ref, getequiprefinerycnt(8);
    		set .@card1, getequipcardid(8,0);
    		set .@card2, getequipcardid(8,1);
    		set .@card3, getequipcardid(8,2);
    		set .@card4, getequipcardid(8,3);
    		delitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, .@card4;
    		getitem2 .@id, 1, 1, .@ref, 0, .@card1, .@card2, .@card3, 4700;
    		equip .@id;
    		specialeffect 101;
    		cutin "jpn_darkalgol11",2;
    		sleep2 200;
    		cutin "",255;
    		mes "Dark Argol";
    		mes "Enchant exitoso!.";
    		end;
    	}
    		
    	mes "Dark Argol";
    	cutin "jpn_darkalgol07",2;
    	mes "eh eh ehhh! Espera";
    	mes "No llevas escudo equipado.";
    	close2;
    	cutin "",255;
    	end;
    	
    	Faltaitems:
    	cutin "jpn_darkalgol01",2;
    	mes "Dark Argol";
    	mes "Vuelve conmigo cuando tengas todos los items que te pedi!";
    	mes "hasta pronto";
    	close2;
    	cutin "",255;
    	end;
    }

     

  3. OnClock0000:
    	addrid(0);
    	set newday, newday + 1; 
    	end;

    You can use addrid. 

    *addrid(<type>{,<flag>{,<parameters>}});
    
    This command will attach other RIDs to the current script without detaching the
    invoking RID. It returns 1 if successful and 0 upon failure.
    
    <type> determines what RIDs are attached:
     0: All players in the server.
     1: All players in the map of the invoking player, or the invoking NPC if no player is attached.
     2: Party members of a specified party ID.
        [ Parameters: <party id> ]
     3: Guild members of a specified guild ID.
        [ Parameters: <guild id> ]
     4: All players in a specified area of the map of the invoking player (or NPC).
        [ Parameters: <x0>,<y0>,<x1>,<y1> ]
     5: All players in the map.
        [ Parameters: "<map name>" ]
     Account ID: If type is Account ID, attach the specified account ID.
    
    <flag> can prevent certain players from being attached:
     0: Players are always attached. (default)
     1: Players currently running another script will not be attached.

     

    • MVP 1
  4. You can try below script and let me know if it works ?

    -	shop	PVPSHOP	-1,501:20000
    
    prontera,150,150,0	script	PVP Points Shop	100,{
        callshop "PVPSHOP", 1;
        npcshopattach "PVPSHOP";
        end;
       
        OnBuyItem:
            for (.@j = 0; .@j < getarraysize(.items); .@j += 2) {
                for (.@k = 0; .@k < getarraysize(@bought_nameid); .@k++) {
                    if (@bought_nameid[.@k] == .items[.@j]) {
                        if (checkweight(@bought_nameid[.@k],@bought_quantity[.@k])) {
                            if (#PVPPOINTS < .items[.@j+1] || #PVPPOINTS < (.items[.@j+1] * @bought_quantity[.@k]))
                                dispbottom "You don't have enough PVP points";
                            else {
    							#PVPPOINTS -= .items[.@j+1] * @bought_quantity[.@k];
                                getitem @bought_nameid[.@k], @bought_quantity[.@k];
                            }
                        } else dispbottom "You cannot carry out more items with you";
                    }
                }
            }
    		// clean up before ending
            deletearray @bought_quantity, getarraysize(@bought_quantity);
            deletearray @bought_nameid, getarraysize(@bought_nameid);
            end;
     
        OnInit:
            setarray .items, 1000,1,1001,2; // Usage : <item id>,<price>{,<item id>,<price>}
            npcshopitem "PVPSHOP",0,0;
            for (.@i = 0; .@i < getarraysize(.items); .@i += 2)
                npcshopadditem "PVPSHOP", .items[.@i], .items[.@i+1];
            end;
    }
    
    -	script	Func_PVP	-1,{
    	OnPCKillEvent:
    		if (getcharid(3) == killedrid || strcharinfo(3) != "prontera") end;
    		#PVPPOINTS += .p[0];
    		dispbottom "You won " + .p[0] + " pvp points. New pvp points is " + #PVPPOINTS;
    		end;
    		
    	OnPCDieEvent:
    		if (getcharid(3) == killerrid  || strcharinfo(3) != "prontera") end;
    		if (#PVPPOINTS > .p[1]) {#PVPPOINTS -= .p[1];}
    		else {#PVPPOINTS = 0;}
    		dispbottom "You lost " + .p[1] + " pvp points. New pvp points is " + #PVPPOINTS;
    		end;
    
    	OnCheckPoint:
    		dispbottom "You currently have " + #PVPPOINTS + " pvp points.";
    		end;
    	OnInit:
    		setarray .p[0], 2, 1; // points per kill, points per death
    		bindatcmd "checkpoints", strnpcinfo(0) + "::OnCheckPoint";
    		end;
    }

     

  5. On 3/21/2020 at 4:55 AM, Mythryx said:

    Hi! just wanted to ask if the script floating_rates will revert back to normal after 1 hour? 

    If no, can someone teach me on how to make that so?

    Really wanted to try and add Happy Hours to my server. like 2 times a day or so.

    You can try below

    -	script	FloatExp	-1,{
    	OnMinute00:
    		if (.floated) {
    			setbattleflag "base_exp_rate", .currentRates[0];
    			setbattleflag "job_exp_rate", .currentRates[1];
    			announce "Server rates are now back to normal. Rates are " + getbattleflag("base_exp_rate") + "/" + getbattleflag("job_exp_rate"), bc_all;
    			.floated = 0;
    		}
    		end;
    	OnTrig:
    		setarray .@i[ 0 ], 100, 150, 200;
    		.@a = .@i[ rand( getarraysize( .@i ) ) ];
    		setbattleflag "base_exp_rate", .@a;
    		setbattleflag "job_exp_rate", .@a;
    		announce "Server rates are adjusted. New rates are " + getbattleflag("base_exp_rate") + "/" + getbattleflag("job_exp_rate"), bc_all;
    		.floated = 1;
    		end;
    	OnInit:
    		bindatcmd "floatexp", strnpcinfo(0) + "::OnTrig";
    		setarray .currentRates[0], getbattleflag("base_exp_rate"), getbattleflag("job_exp_rate");
    		end;
    }

    Use @floatexp to readjust the base/job exp rates

  6. Not tested

    - script FloatingExp -1,{
    OnMinute00:
    if ( gettime( 3 ) % 2 ) end;
    setarray .@i[ 0 ], 10, 15, 20, 25, 30, 35, 40;
    .@a = .@i[ rand( getarraysize( .@i ) ) ];
    setbattleflag "base_exp_rate", .@a;
    setbattleflag "job_exp_rate", .@a;
    end;
    }
  7.  

    I guess this explains all the crashes and twenty minute downtimes the past few days. Will be nice to see the site up and running at all times again.

    Thanks for the update,

    ~Azura Skyy

    o_o... I never faced those issues? 

     

    I encountered downtime these past few days. :P

  8. Much better if you consult the document provided by the rA staffs : doc/script_commands.txt

    *disablenpc "<NPC object name>";
    *enablenpc "<NPC object name>";
    
    These two commands will disable and enable, respectively, an NPC object
    specified by name. The disabled NPC will disappear from sight and will no longer
    be triggerable in the normal way. It is not clear whether it will still be
    accessible through 'donpcevent' and other triggering commands, but it probably
    will be. You can disable even warp NPCs if you know their object names, which is
    an easy way to make a map only accessible through walking half the time. Then
    you 'enablenpc' them back.
    
    You can also use these commands to create the illusion of an NPC switching
    between several locations, which is often better than actually moving the NPC -
    create one NPC object with a visible and a hidden part to their name, make a few
    copies, and then disable all except one.

    @Promise provided you a template. 

    OnAgitStart:
    OnAgitStart2:
    disablenpc "<NPC object name>";
    disablenpc "<NPC object name>";
    disablenpc "<NPC object name>";
    disablenpc "<NPC object name>";
    disablenpc "<NPC object name>";
    
    OnAgitEnd:
    OnAgitEnd2:
    enablenpc "<NPC object name>";
    enablenpc "<NPC object name>";
    enablenpc "<NPC object name>";
    enablenpc "<NPC object name>";
    enablenpc "<NPC object name>";
  9. -	script	Sample	-1,{
    	function push; function pull; function display; function size;
    	OnPCLoadMapEvent:
    		getmapxy( .@map$, .@x, .@y, 0 );
    		if ( .@map$ == "prontera" )
    			push( getcharid( 3 ) );
    		end;
    	OnPCDieEvent:
                    if ( strcharinfo( 3 ) != "prontera" ) end;
    		warp "SavePoint", 0, 0;
    		pull( getcharid( 3 ) );
    		end;
    	OnPCKillEvent:
    		if ( size() == 1 && strcharinfo( 3 ) == "prontera" )
    			display();
    		end;
    	
    	function	display	{
    		for ( .@x = 0; .@x < getarraysize( .Queue ); .@x++ )
    			announce "" + rid2name( .Queue[ .@x ] ) + "", 0;
    		return;
    	}
    	function	size	{
    		return getarraysize( .Queue );
    	}
    	function	push	{
    		for ( .@i = 0; .@i < getargcount(); .@i++ ) {
    			for ( .@x = 0; .@x < getarraysize( .Queue ); .@x++ ) {
    				if ( .Queue[ .@x ] == getarg( .@i ) )
    					deletearray .Queue[ .@x ], 1;
    			}
    			.Queue[ getarraysize( .Queue ) ] = getarg( .@i );
    		}
    		return;
    	}
    	function	pull	{
    		for ( .@i = 0; .@i < getargcount(); .@i++ ) {
    			for ( .@x = 0; .@x < getarraysize( .Queue ); .@x++ ) {
    				if ( .Queue[ .@x ] == getarg( .@i ) )
    					deletearray .Queue[ .@x ], 1;
    			}
    		}
    		return;	
    	}
    }
    
    prontera	mapflag	loadevent
    

    Not tested though. Change prontera to your desired map

×
×
  • Create New...