Jump to content

pajodex

Members
  • Posts

    439
  • Joined

  • Last visited

  • Days Won

    26

Posts posted by pajodex

  1. -	script	vip_info	-1,{
    OnVIPInfo:
    	if (!vip_status(VIP_STATUS_ACTIVE)) {
    		dispbottom "You are not a VIP member. You may purchase one at Cash Shop.",0xff0000;
    		end;
    	}
    	dispbottom "VIP Time Left: "+ Time2Str(vip_status(VIP_STATUS_REMAINING)+gettimetick(2)),0x5cdcff;
    	end;
    OnInit:
    	bindatcmd "vipinfo", strnpcinfo(0)+"::OnVIPInfo";
    }

     

  2. Hi,

    As the title speak (I have asked this over discord), how do I retrieve data from a custom sql table ROA_VALUE so that a custom random option will update everytime the data is also updated. I have tried using `setrandomoption` and it is working .However I find it a hassle to look at everytime I update it via script command because the item is unequipped then re-equipped..

    Maybe little hints might be great..

    *Im not sure if im posing on right section but kindly move it if it isn't. Thank you ?

  3. 2 hours ago, Quesooo said:

    How can i do this on blessed refiner?
     

    using latest rathena database

     

    
    //===== rAthena Script ======================================= 
    //= Blessed Refiner
    //===== Description: =========================================
    //= [Official Conversion]
    //= Refiners that use Blessed ores to refine equipment.
    //= Upon failure, the equipment is not destroyed. The success
    //= rate is identical to that for Enriched ores.
    //= - "Blacksmith Dister" only refines from +6~12.
    //= NOTE: This NPC is currently disabled on official servers.
    //===== Changelog: ===========================================
    //= 1.0 First version. [Euphy]
    //= 1.1 Removed re-roll behavior. [Secret]
    //============================================================
    
    // Main NPC :: new_smelting612
    //============================================================
    -	script	::BlacksmithDister	-1,{
    	disable_items;
    	mes "[Blacksmith Dister]";
    	mes "In this highly competitive society, we must be different in order to survive!";
    	mes "I only refine equipment at the +6 ~ 12 levels.";
    	next;
    	mes "[Blacksmith Dister]";
    	mes "I will need ^ff9999Blessed Oridecon^000000 for weapons, and ^ff9999Blessed Elunium^000000 for armors.";
    	mes "Failed refines ^FF0000will not break or reduce the refine level^000000.";
    	next;
    	mes "[Blacksmith Dister]";
    	mes "How about it? Do you want to refine?";
    	next;
    	setarray .@indices[1], EQI_HEAD_TOP, EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, EQI_GARMENT, EQI_SHOES, EQI_ACC_L, EQI_ACC_R, EQI_HEAD_MID, EQI_HEAD_LOW;
    	for(set .@i,1; .@i<=10; set .@i,.@i+1)
    		set .@menu$, .@menu$ + ( getequipisequiped(.@indices[.@i]) ? getequipname(.@indices[.@i]) : F_getpositionname(.@indices[.@i]) +"-[Unequipped]" ) +":";
    	set .@part, .@indices[ select(.@menu$) ];
    	if (!getequipisequiped(.@part)) {
    		mes "[Blacksmith Dister]";
    		switch(.@part) {
    		case 1:
    			mes "I'm a blacksmith, not a hairstylist.";
    			break;
    		case 2:
    			mes "With my hammer, I will make you a star of the sky.";
    			break;
    		case 3:
    		case 4:
    			mes "Making artificial hands is not my specialty.";
    			break;
    		case 5:
    			mes "Bring out the item so I can refine it!";
    			break;
    		case 6:
    			mes "Where is this weird smell coming from?";
    			break;
    		case 7:
    		case 8:
    			mes "Where is the accessory?";
    			break;
    		case 9:
    			mes "What do you want me to refine?";
    			break;
    		case 10:
    			mes "Huh? What do you want me to do?";
    			break;
    		}
    		close;
    	}
    	if (!getequipisenableref(.@part)) {
    		mes "[Blacksmith Dister]";
    		mes "This item cannot be refined.";
    		close;
    	}
    	.@equip_id = getequipid(.@part);
    	.@equip_refine = getequiprefinerycnt(.@part);
    	setarray .@card[0], getequipcardid(.@part,0), getequipcardid(.@part,1), getequipcardid(.@part,2), getequipcardid(.@part,3);
    
    	if (.@equip_refine < 6 || .@equip_refine > 12) {
    		mes "[Blacksmith Dister]";
    		mes "This equipment has refined to "+.@equip_refine+". I only handle items with refine levels from +6 to +12!";
    		close;
    	}
    	set .@equip_lv, getequipweaponlv(.@part);
    	switch(.@equip_lv) {
    	default:
    	case 0:
    		set .@price,20000;
    		set .@material,6439; //Unbreakable_Def
    		set .@type$,"Armor";
    		break;
    	case 1:
    		set .@price,1000;
    		set .@material,6438; //Unbreakable_Weap
    		set .@type$,"Weapon";
    		break;
    	case 2:
    		set .@price,2000;
    		set .@material,6438; //Unbreakable_Weap
    		set .@type$,"Weapon";
    		break;
    	case 3:
    		set .@price,20000;
    		set .@material,6438; //Unbreakable_Weap
    		set .@type$,"Weapon";
    		break;
    	case 4:
    		set .@price,40000;
    		set .@material,6438; //Unbreakable_Weap
    		set .@type$,"Weapon";
    		break;
    	}
    	set .@ore$,"^ff9999Blessed "+.@type$+" Ore^000000";
    	mes "[Blacksmith Dister]";
    	mes "This "+.@type$+" has been refined to "+.@equip_refine+". To refine it, I need "+.@ore$+" and a "+callfunc("F_InsertComma",.@price)+" zeny refining fee.";
    	mes "Do you want to proceed?";
    	next;
    	if(select("Yes:No") == 2) {
    		mes "[Blacksmith Dister]";
    		mes "I am busy, don't joke with me!";
    		close;
    	}
    	if (getequippercentrefinery(.@part) < 100) {
    		mes "[Blacksmith Dister]";
    		mes "This "+.@type$+" has been refined many times. Although it will not disappear upon failure, the "+.@ore$+" will disappear!";
    		next;
    		mes "[Blacksmith Dister]";
    		mes "Of course, the refining fee will not be returned! Do you want to continue?";
    		next;
    		if(select("Yes:No") == 2) {
    			mes "[Blacksmith Dister]";
    			mes "Good. I'd be sad if it failed, too.";
    			close;
    		}
    	}
    	if (countitem(.@material) == 0 || Zeny < .@price) {
    		mes "[Blacksmith Dister]";
    		mes "Materials insufficient.";
    		mes "To refine "+((.@equip_lv)?"a level "+.@equip_lv+" weapon":"armor")+", I need "+.@ore$+" and a "+callfunc("F_InsertComma",.@price)+" zeny refining fee.";
    		close;
    	}
    	delitem .@material,1;
    	set Zeny, Zeny-.@price;
    
    	// anti-hack
    	if (callfunc("F_IsEquipIDHack", .@part, .@equip_id) || callfunc("F_IsEquipCardHack", .@part, .@card[0], .@card[1], .@card[2], .@card[3]) || callfunc("F_IsEquipRefineHack", .@part, .@equip_refine))
    		close;
    
    	mes "[Blacksmith Dister]";
    	mes "Tac! Tac! Tac!";
    	if (getequippercentrefinery(.@part, true) > rand(100)) {
    		specialeffect EF_BLESSING;
    		successrefitem .@part;
    		next;
    		mes "[Blacksmith Dister]";
    		mes "Hahahahahaha!!!";
    		next;
    		mes "[Blacksmith Dister]";
    		mes "Refine was a huge success~ Hahaha!";
    		close;
    	}
    	specialeffect EF_CURSEATTACK;
    	specialeffect2 EF_SUI_EXPLOSION;
    	next;
    	emotion (!rand(5))?ET_ANGER:ET_HUK;
    	mes "[Blacksmith Dister]";
    	mes "Oh my goodness!!!!";
    	next;
    	mes "[Blacksmith Dister]";
    	mes "Oh! Although it was blessed by "+.@ore$+" to retain the equipment...";
    	next;
    	mes "[Blacksmith Dister]";
    	mes "My mood is worse when I fail!!";
    	close;
    }
    prt_in,52,56,3	duplicate(BlacksmithDister)	Blacksmith Dister#prt	826
    payon,148,172,3	duplicate(BlacksmithDister)	Blacksmith Dister#pay	826
    alberta_in,20,56,3	duplicate(BlacksmithDister)	Blacksmith Dister#alb	826
    yuno_in01,175,18,3	duplicate(BlacksmithDister)	Blacksmith Dister#yuno	826
    ein_in01,26,82,3	duplicate(BlacksmithDister)	Blacksmith Dister#ein	826
    lhz_in02,280,15,3	duplicate(BlacksmithDister)	Blacksmith Dister#lhz	826

     

    thank you.

    add this

    if(getequiprefinerycnt(.@part) < 10) failedrefitem .@part // if refine is less than +10... item will break..

    above 

    Line 166: specialeffect EF_CURSEATTACK;

     

    • MVP 1
  4. payo2,75,115,5	script	Race to 99 Reward NPC	99,{
    .@MaxBLevel = 99; //Set your servers max base level here.
    .@MaxJLevel = 50;  //Set your servers max job level here.
    setarray .@item, // set rewards
    	6046, 3, // <ID>, <AMT>
    	7539, 25,
    	23025, 1,
    	23034, 1;
    if ( LReward ) { // checks if you already get the reward.
    	mes "No more rewards.";
    	close;
    }
    if(BaseLevel < .@MaxBLevel &&  JobLevel < .@MaxJLevel ) {
    	mes "You don't have the required level yet.";
    	mes "Come back when you reached it - Base Level "+.@MaxBLevel+" - Job Level "+.@MaxJLevel+"!";
    	close;
    }
    mes "Congratulations, you've reached the max level in the server, here's your reward!";
    close2;
    LReward = true; // sets LReward to true which means you already get your item.
    for(.@i=0;.@i<getarraysize(.@item);.@i+=2)
    	getitem .@item[.@i], .@item[.@i+1];
    end;
    }

     

  5. Thanks buddy, I will try this

    There finally working, I was using the same diff before. But I think I have missed a line when I implemented it. Thanks for a better and clearer copy /heh 

    • Like 1
  6. // Note: the character needs to have the skill MC_PUSHCART to gain a cart
    prontera,149,180,0	script	Cart Select	100,{
    	// zeny cost of cart.
    	setarray .@cart_cost[1],
    		100, // cart 1
    		200,
    		300,
    		400,
    		500,
    		600,
    		700,
    		800,
    		900,
    		1000,
    		1100,
    		1200; // cart 12
    	if (!checkcart()) {
    		mes "You must have a cart.";
    		close;
    	}
    	mes "Choose a cart:";
    	next;
    	.@menu$ = "";
    	for (.@i=1; .@i<13; .@i++) {
    		.@menu$ += "Cart #"+.@i;
    		.@menu$ += ":";
    	}
    	.@s = select(.@menu$);
    	mes "You selected Cart #"+ .@s;
    	mes " ";
    	mes "Cost price is "+ F_InsertComma(.@cart_cost[.@s]) +"z.";
    	next;
    	if(select("Yes","No")==2) close;
    	if (Zeny < .@cart_cost[.@s]) {
    		mes "Not enough zeny,";
    		close;
    	}
    	Zeny -= .@cart_cost[.@s];
    	setcart .@s;
    	mes "Goodluck!";
    	close;
    }

     

  7. Script-wise, yes maybe.. once they get the title. attachnpc timer to player. after an hour, remove the achievement..

    *achievementremove(<achievement id>{,<char id>})
    
    This function will remove an achievement from the player's log for the attached
    player or the supplied <char id>.
    Returns true on success and false on failure.

     

  8. // Disclaimer :
    // Yes this code is from example 2 of script_commands.txt
    
    prontera,150,180,0	script	PvP Party Warper	100,{
    	.@pvpmap$ = "guild_vs1"; // Pvp map
    	.@register_num = 45; // How many party members are required?
    	
    	getpartymember getcharid(1), 1;
    	getpartymember getcharid(1), 2;
    
    	if ( !getcharid(1) || $@partymembercount != .@register_num ) {
    		mes "Please form a party of " + .@register_num + " to continue";
    		close;
    	}
    	for ( .@i = 0; .@i < $@partymembercount; .@i++ )
    		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
    			.@count_online++;
    	if ( .@count_online != .@register_num ) {
    		mes "All your party members must be online to continue";
    		close;
    	}
    	copyarray .@partymembercid, $@partymembercid, .@register_num;
    	mes "Are you ready ?";
    	next; 
    	select("Yes");
    	getpartymember getcharid(1), 1;
    	if ( $@partymembercount != .@register_num ) {
    		mes "You've made changes to your party !";
    		close;
    	}
    	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
    		if ( .@partymembercid[.@i] != $@partymembercid[.@i] ) {
    			mes "You've made changes to your party !";
    			close;
    		}
    	}
    	warpparty .@pvpmap$, 0,0, getcharid(1);
    	end;
    }

     

    • Like 1
  9. 32 minutes ago, Tassadar said:

    You can show me how I use? Where in npc I did put all npnwalktos?

    
    shop	custom_seller21	-1,673:1000000 // Create our dummy shop.
    
    prontera,150,150,4	script	[Máquina Cartas]	564,{
    	
    // This code runs when the user clicks our npc.
    	mes "[^FF2400Cuidado^000000] Escolha um item!"; // Let the user know about our shop.
    	callshop "custom_seller21",1; // Summon our dummy shop filled with custom items.
    	
    	npcshopattach "custom_seller21"; // Attach the shop to this npc.
    	
    	end;
    
    // This code runs when a user purchases an item from out shop.
    OnBuyItem:
    	.@len = getarraysize(.customs); // Get the number of customs we're adding.
    	.@b_len = getarraysize(@bought_nameid); // Get the number of purchased items.
    
    	for( set @i, 0; @i < .@len; set @i, @i+1 ) {
    		for( set @d,0; @d < .@b_len; set @d, @d+1 ) {
    			if( @bought_nameid[@d] == .customs[@i] ) { // Check if the purchased item equals our custom item.
    				if( countitem(.CoinID) >= .Price[@i] * @bought_quantity[@d] ) { // Check if the user has the correct funds.
    					delitem .CoinID,.Price[@i]*@bought_quantity[@d];
    					getitem @bought_nameid[@d],@bought_quantity[@d];
    				}
    			}
    		}
    	}
    	deletearray @bought_quantity, getarraysize(@bought_quantity); // Remove the array.
    	deletearray @bought_nameid, getarraysize(@bought_nameid); // Remove the array.
    	close;
    	
    // Npc walks every 10 sec
    OnTimer10000:
    	.@x = .npc_x + rand( -10,10 );
    	.@y = .npc_y + rand( -10,10 );
    	npcwalkto .@x,.@y;
    	setnpctimer 0;
    	end;
    
    // This code runs first. When the server is started.
    OnInit:
    	setarray .customs[0],4035,4060,4063; // An array of out custom items.
    	
    	set .CoinID,1226; // ID da Moeda em uso.
    	
    	setarray .Price[0],500,500,500; // The amount of coins needed for our items. (For example: Item 12103 = 20 coins)
    	
    	npcshopitem "custom_seller21",0,0; // Remove all items from our dummy shop.
    	
    	for( set .@i, 0; .customs[.@i]; set .@i, .@i+1 ) // Loop through our custom items.
    		npcshopadditem "custom_seller10",.customs[.@i],.Price[.@i]; // Add our custom items to the cleared dummy shop.
    
    	npcspeed 200;
        getmapxy( .npc_map$, .npc_x, .npc_y,1 );
        initnpctimer;
        end;
       
    	end;
    }

     

    • Like 1
  10. 1 hour ago, Tassadar said:

    Good night..

    I need to make a simple modification to a npc I already have, but I do not know if this is possible.

    I need an npc shop item to be walking in the middle of prontera.

    
    shop	custom_seller21	-1,673:1000000 // Create our dummy shop.
    
    prontera,150,150,4	script	[Máquina Cartas]	564,{
    	
    // This code runs when the user clicks our npc.
    	mes "[^FF2400Cuidado^000000] Escolha um item!"; // Let the user know about our shop.
    	callshop "custom_seller21",1; // Summon our dummy shop filled with custom items.
    	
    	npcshopattach "custom_seller21"; // Attach the shop to this npc.
    	
    	end;
    
    // This code runs when a user purchases an item from out shop.
    OnBuyItem:
    	.@len = getarraysize(.customs); // Get the number of customs we're adding.
    	.@b_len = getarraysize(@bought_nameid); // Get the number of purchased items.
    
    	for( set @i, 0; @i < .@len; set @i, @i+1 ) {
    		for( set @d,0; @d < .@b_len; set @d, @d+1 ) {
    			if( @bought_nameid[@d] == .customs[@i] ) { // Check if the purchased item equals our custom item.
    				if( countitem(.CoinID) >= .Price[@i] * @bought_quantity[@d] ) { // Check if the user has the correct funds.
    					delitem .CoinID,.Price[@i]*@bought_quantity[@d];
    					getitem @bought_nameid[@d],@bought_quantity[@d];
    				}
    			}
    		}
    	}
    	deletearray @bought_quantity, getarraysize(@bought_quantity); // Remove the array.
    	deletearray @bought_nameid, getarraysize(@bought_nameid); // Remove the array.
    	close;
    
    // This code runs first. When the server is started.
    OnInit:
    	setarray .customs[0],4035,4060,4063; // An array of out custom items.
    	
    	set .CoinID,1226; // ID da Moeda em uso.
    	
    	setarray .Price[0],500,500,500; // The amount of coins needed for our items. (For example: Item 12103 = 20 coins)
    	
    	npcshopitem "custom_seller21",0,0; // Remove all items from our dummy shop.
    	
    	for( set .@i, 0; .customs[.@i]; set .@i, .@i+1 ) // Loop through our custom items.
    		npcshopadditem "custom_seller10",.customs[.@i],.Price[.@i]; // Add our custom items to the cleared dummy shop.
    	
    	end;
    }

    If it is possible could someone show me how to do it?

    If it is possible to do this I can put the sprite of a monster that he will walk?

    I thank you for your help.

    *npcspeed <speed value>;
    *npcwalkto <x>,<y>;
    *npcstop;
    
    These commands will make the NPC object in question move around the map. As they
    currently are, they are a bit buggy and are not useful for much more than making
    an NPC move randomly around the map.
    
    'npcspeed' will set the NPCs walking speed to a specified value. As in the
    @speed GM command, 200 is the slowest possible speed while 0 is the fastest
    possible (instant motion). 100 is the default character walking speed.
    
    'npcwalkto' will start the NPC sprite moving towards the specified coordinates
    on the same map it is currently on. The script proceeds immediately after the
    NPC begins moving.
    
    'npcstop' will stop the motion.
    
    While in transit, the NPC will be clickable, but invoking it will cause it to
    stop moving, which will make its coordinates different from what the client
    computed based on the speed and motion coordinates. The effect is rather
    unnerving.
    
    Only a few NPC sprites have walking animations, and those that do, do not get
    the animation invoked when moving the NPC, due to the problem in the NPC walking
    code, which looks a bit silly. You might have better success by defining a job-
    sprite based sprite id in 'db/mob_avail.txt' with this.

    Then add npctimers..

  11. Hi, I just want to share MY version of Ragnarok Online Battle Royale!

    Disclaimer: This is a paid script request by @DepTrai for his server. I asked permission to showcase this script. So, big thanks to you.

    So, basically, just like any other battle royale..

    • Players will be warped in the battle field. 
    • Play zone will be restricted.
    • If they will die or logout, all loots will be dropped.
    • Last man standing will be the winner.

    Here is a video

    Spoiler

     

     

    • Upvote 1
  12. ========================
    | 5. AutoSpell Bonuses |
    ========================
    NOTES:
      - For all AutoSpell bonuses, target does not have be within the spell's range to go off.
      -- Enable conf/battle/battle.conf::autospell_check_range to force a range check.
      - By default, AutoSpell skills are casted on target unless it is a self or support skill (inf = 4/16).
    
    bonus3 bAutoSpell,sk,y,n;       	Adds a n/10% chance to cast skill sk of level y when attacking
    bonus3 bAutoSpellWhenHit,sk,y,n;	Adds a n/10% chance to cast skill sk of level y when being hit by a direct attack
    
    bonus4 bAutoSpell,sk,y,n,i;          	Adds a n/10% chance to cast skill sk of level y when attacking
    bonus5 bAutoSpell,sk,y,n,bf,i;       	Adds a n/10% chance to cast skill sk of level y when attacking with trigger criteria bf
    bonus4 bAutoSpellWhenHit,sk,y,n,i;   	Adds a n/10% chance to cast skill sk of level y when being hit by a direct attack
    bonus5 bAutoSpellWhenHit,sk,y,n,bf,i;	Adds a n/10% chance to cast skill sk of level y when being hit by a direct attack with trigger criteria bf
                                            i provides additional options (bitfield):
                                              &0 = cast on self
                                              &1 = cast on enemy
                                              &2 = use random skill level in [1..y]
                                              &3 = 1+2 (random level on enemy)
    
    bonus4 bAutoSpellOnSkill,sk,x,y,n;  	Adds a n/10% chance to autospell skill x at level y when using skill sk
    bonus5 bAutoSpellOnSkill,sk,x,y,n,i;	Adds a n/10% chance to autospell skill x at level y when using skill sk
                                        	i provides additional options (bitfield):
                                        	  &1 = forces the skill to be casted on self, rather than on the target of skill sk
                                        	  &2 = random skill level in [1..y] is chosen

    .../doc/item_bonus.txt

  13. [FREE] Fortress Battleground


    Hi, 

    It's been a while.. I was bored and feels good today.. So I will release a free BG script I wrote months ago.. I updated some of its parts like UNITTYPE_ to BL_ to avoid any warning messages on latest rathena console.. but if your using an older ra version, Just search BL_ and replace  with UNITTYPE_ ..

    Enough with the talking, here is how this works.. ( I was about to make a video but I got lazy )

    Spoiler

     

    1. Players registers

    2. Once minimum players requirements met, BG will start..

    3. Players will be teamed up randomly..

    4. A fort is located at the center of the map, each team must break the Fort.. ( just like WOE )

    5. Team who holds the fort until the end of the battleground will win.. ( just like WOE )

    (NOTE: If you don't own the fort, the Fort will defend itself.. Yes, it will damage players around the fort if you don't own it )

     


     

    Quote

     

    Additional info:

    1. Both teams have mini-forts, it will allow them to regenerate for some amount of HP/SP over time. But if you go to your enemy's mini-fort, Be warry, you will die..

     

    I tested it and it is working (03-24-2019).. I don't think I would support this script further because I will be busy. Well, you are free to edit this as much as you need.. Just don't remove my signature and Don't resell this..

    Enjoy and have a great day!


     

  14. 41 minutes ago, NakedWolf said:

    am just wondering what fixed the error .it was giving error on my offline rAthena and when i uploaded it on my online one it is working fine ?

    I was suspecting it loaded the RUBGController npc first.. therefore it loaded the commands first too which the rest of the scripts are loaded after that npc was loaded.. maybe your offline server wasn't able to simultaneously load the rest of the npcs while it loaded RUBGController which caused the problem.

  15. https://pastebin.com/jptQvwtW -- English version

     

    Translated to English.. I didn't bothered correcting some grammar.. Tested it and so far I encountered minor problems like mobs all over the area. I bet it needs to be a fully-fledged PUBG script only server? If im not mistaken.. Anyways this can be optimized on a lot of ways.. Im eyeing to optimize this to a sole instanced battleground system once I get a time..

×
×
  • Create New...