Jump to content

Cretino

Members
  • Posts

    50
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by Cretino

  1. 2 hours ago, bu3nox said:

    if(getgroupid() < .lv){

    O problema está nessa parte do código, ele está verificando uma variável que não está declarada no script, variável '.lv'.

    Você só precisa fazer isto:

    De:

    Spoiler
    
    if(getgroupid() < .lv){

     

    Para:

    Spoiler
    
    if(getgroupid() < .groupid){

     

    Espero que tenha entendido o problema e tenha te ajudado. ?

  2. The problem is '.round' variable, your script don't reset the value when executes the first time.

    Try this one I changed:

    Spoiler
    
    // Original script by Unknown
    // Edit by Mabuhay
    // Removed my timer cool downs and stuff.
    // Adjust to your time you wish for it to start.
    
    -	script	Event_Bombring	-1,{
    OnInit:
    	// item reward
    	setarray .item,
    		501, 10,
    		502, 5;
    
    	// @bombstart - gm manual start
    	bindatcmd "bombstart", strnpcinfo(0)+"::OnStart",60,60;
    	
    	// @bomb - player join event
    	bindatcmd "bomb", strnpcinfo(0)+"::OnJoinEvent";
    	
    	// Mapflags
    	setarray .@mapflag,
    		mf_nowarp,
    		mf_nowarpto,
    		mf_noskill,
    		mf_noteleport,
    		mf_nomemo,
    		mf_nosave,
    		mf_noicewall,
    		mf_nobranch,
    		mf_noreturn,
    		mf_nocommand;
    		
    	for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
    		setmapflag "quiz_02", .@mapflag[.@i];
    	end;
    	
    OnJoinEvent:
    	mes " [ Event Status ] ";
    	switch ( .start ) {
    		case 1: .@status$ = "active"; break;
    		case 2: .@status$ = "on-going"; break;
    		default: .@status$ = "not active"; break;
    	}
    	mes "Event is currently ^ff0000"+ .@status$ +"^000000";
    	next;
    	switch(select(
    		"Bombring Event - "+ ((.start == 1) ? "^0000ffJoin Event":((.start == 2) ? "^0000ffEvent On-Going":"^ff0000Not Available"))+"^000000" )) {
    	case 1:
    		if ( !.start ) {
    			mes "Event is not available.";
    			close;
    		} else if ( .start == 2 ) {
    			mes "Event is on-going";
    			close;
    		}
    		sc_end SC_ALL;
    		sc_start SC_DECREASEAGI,600000,10;
    		percentheal 100,100;
    		warp "quiz_02",59,345;
    	}
    	end;
    
    OnStart:
    // Add your clock timers here.
    OnClock0000: // 12 MN
    OnClock0300: // 3 AM
    OnClock0600: // 6 AM
    OnClock1700: // 5 PM
    	if ( .start ) end;
    	.start = 1;
    	.round = 0;
    	killmonsterall "quiz_02";
    	announce "Bombring: We are going to have a Bombring event.",0;
    	sleep 10000;
    	announce "Bombring: For those who wants to join, use @bomb",0;
    	sleep 10000;
    	announce "Bombring: After 1 Minute Event will close.",0;
    	sleep 10000;
    	announce "Bombring: So please if you want to join. use @bomb",0;
    	sleep 60000;
    	announce "Bombring: The entry to the event is now closed.",bc_all,0x0ceedb;
    	if ( getmapusers("quiz_02") < 1 ) {
    		announce "Bombring: Not enough participants.",bc_all,0x0ceedb;
    		.start = false;
    		.round = 0;
    		mapwarp "quiz_02", "prontera", 150, 180; // warp out.
    		end;
    	}
    	.start = 2;
    	sleep 3500;
    	mapannounce "quiz_02","We're about to begin the event.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_02","The rules are simple.",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "quiz_02","Event will run for 30 seconds for 5 total rounds.",bc_map,0x0ceedb;
    	sleep 2500;
    	mapannounce "quiz_02","All you have to do is avoid Bombrings and stay alive for 30 seconds.",bc_map,0x0ceedb;
    	sleep 2000;
    	mapannounce "quiz_02","That's all. Let's begin.",bc_map,0x0ceedb;
    	sleep 3000;
    	while ( .round < 5 ) {
    		.@count = getmapusers("quiz_02");
    		.round++;
    		mapannounce "quiz_02","Round "+.round,bc_map,0x0ceedb;
    		areamonster "quiz_02",48,334,71,357,"Run for you life!",1904, 5 * .@count * .round;
    		sleep 10000 - ( 1000*.round );
    	}
    	.@count = getmapusers("quiz_02");
    	if ( !.@count )
    		announce "Bombring: No one survived the bombrings.",bc_all,0x0ceedb;
    	else if ( .@count ) {
    		.@size = getmapunits(BL_PC,"quiz_02",.@aid);
    		.@amt = getarraysize(.item);
    		if ( .@size > 1 ) announce "A lot players has won the Bombring Event.",bc_all,0x0ceedb;
    		for ( .@i = 0; .@i < getarraysize(.@aid); .@i++) {
    			attachrid .@aid[.@i];
    			if ( .@size == 1 ) announce strcharinfo(0)+" has won the Bombring Event.",bc_all,0x0ceedb;
    			for ( .@j = 0; .@j < .@amt; .@j += 2 )
    				getitem .item[.@j], .item[.@j+1];
    		}
    		detachrid;
    	}
    	.start = false;
    	.round = 0;
    	sleep 5000;
    	mapwarp "quiz_02","prontera",rand(148,163),rand(167,186);
    	end;
    	
    OnPCDieEvent:
    	if ( .start && strcharinfo(3) == "quiz_02" )
    		warp "prontera",rand(148,163),rand(167,186);
    	end;
    }

     

    I not tested, but I think will work.

    Good luck. ?

    • Like 1
  3. I think is it, you want to do:

    Spoiler
    
    prontera,154,150,5	script	SampleTest	123,{
    	
    	.@bonus0 = 1;	// Reflect 10% Short-Range Damage
    	.@bonus1 = 3;	// Reduce 10% Aftercast Delay
    	.@bonus2 = 2;	// 8 Mdef
    	.@bonus3 = 8;	// 10% Damage more with Shield Chain
    	.@bonus4 = 5;	// Increase Holy and Grand Cross Damage by 20%
    
    	setarray .@ItemBonus$[0],
    		"Reflect 10% Short-Range Damage",1100000,7561,690,1063,730,
    		"8 Mdef",1500000,7118,275,7162,700,
    		"Reduce 10% Aftercast Delay",1700000,7567,500,1036,800,
    		"Full HP/SP on Resurrection",2000000,951,730,7149,750,
    		"10% Damage more with Shield Chain",2000000,7194,580,7215,890,
    		"10% Increase Healing Power",1400000,6032,400,1096,790,
    		"Uninterruptable Cast",1400000,7125,400,7263,480,
    		"Increase Holy and Grand Cross Damage by 20%",2000000,7223,300,7215,900,
    		"Indestructible",1400000,6023,380,7197,800;
    
    	mes "Sample";
    
    	for(set .@i, 0; .@i < getarraysize(.@ItemBonus$); set .@i, .@i + 6)
    	{
    		for(set .@j, 0; getd(".@bonus" + .@j) > 0; set .@j, .@j + 1)
    		{
    			if (.@ItemBonus$[(getd(".@bonus" + .@j) - 1) * 6] == .@ItemBonus$[.@i])
    			{
    				setd ".@dup"+ (.@i / 6) +"$", .@ItemBonus$[.@i];
    				break;
    			}
    		}
    
    		if (getd(".@dup"+ (.@i / 6) +"$") != .@ItemBonus$[.@i])
    			mes "~ "+ .@ItemBonus$[.@i];
    	}
    
    	close;
    }

     

     

  4. 1 hour ago, Radian said:

    I got this code, and trying to do it by my self.

    
    			getpartymember getcharid(1),0;
    			setarray .@name$[0], $@partymembername$[0];
    				for ( .@i = 0; .@i < getarraysize(.@name$[0]); ++.@i )
    				dispbottom "Your current members are " + .@name$[.@i];
    					.@state = checkvending(.@name$[.@i]);
    						if ( .@state&1 )
    							mes "Someone is currently vending.";
    						if ( .@state&4 )
    							mes "Someone is currently in buying store.";
    						if ( .@state&2 )
    							mes "Someone is currently in autotrading.";
    						end;

    map error is this 

    
    [Error]: buildin_checkvending: Player with nick '' is not found.

     

    Have 2 problems in your function.

    First:

    Spoiler


    
    setarray .@name$[0], $@partymembername$[0];

    You're just setting the first value of '$@partymembername$' array, if you want all values.

    You need to use:

    
    copyarray <destination array>[<first value>],<source array>[<first value>],<amount of data to copy>;

    Example:

    
    copyarray .@name$[0], $@partymembername$[0], $@partymembercount;


     

    Second:

    Spoiler
    
    				for ( .@i = 0; .@i < getarraysize(.@name$[0]); ++.@i )
    				dispbottom "Your current members are " + .@name$[.@i];
    					.@state = checkvending(.@name$[.@i]);

    You forgot to put the 'for' brackets '{}' and when you 'for' loop ends, the script command 'checkvending' is receiving a empty variable.

    This is why you receive this error message.

    You need to this:

    
    				for ( .@i = 0; .@i < getarraysize(.@name$); ++.@i )
    				{
    					dispbottom "Your current members are " + .@name$[.@i];
    
    					.@state = checkvending(.@name$[.@i]);
    
    						if ( .@state&1 )
    							mes "Someone is currently vending.";
    						if ( .@state&4 )
    							mes "Someone is currently in buying store.";
    						if ( .@state&2 )
    							mes "Someone is currently in autotrading.";
    				}

    Complete function:

    
    				getpartymember getcharid(1), 0;
    				copyarray .@name$[0], $@partymembername$[0], $@partymembercount;
    
    				for ( .@i = 0; .@i < getarraysize(.@name$); ++.@i )
    				{
    					dispbottom "Your current members are " + .@name$[.@i];
    
    					.@state = checkvending(.@name$[.@i]);
    
    						if ( .@state&1 )
    							mes "Someone is currently vending.";
    						if ( .@state&4 )
    							mes "Someone is currently in buying store.";
    						if ( .@state&2 )
    							mes "Someone is currently in autotrading.";
    				}
    
    				end;

     

     

    • Love 1
  5. 2 hours ago, cumbe11 said:

    How could I place an ad when someone bought an item at the store?

     

    and I wonder if this time is correct ...
    Is he giving 1 point every 1 hour?

    I was wondering if I could show a countdown timer to earn the point.

     

    To put a announce is simple, you just need this script command:

    announce "<text>",<flag>{,<fontColor>{,<fontType>{,<fontSize>{,<fontAlign>{,<fontY>}}}}};

    Just add the 'announce' after the 'getitem':

    Spoiler
    
    			else
    			{
    				set #fidelidade, #fidelidade - @PriceT;
    
    				getitem @bought_nameid[@n], @bought_quantity[@n];
    
    				announce "[" + strcharinfo(0) + "] bought [" + getitemname(@bought_nameid[@n]) + "] x" + @bought_quantity[@n] + "!!", bc_all;
    			}

     

    Now, about show a countdown timer...

    You'll need to remake the script, changing 'addtimer' to other function.

    I suggest you look at 'doc/script_commands.txt' file or look for one script with hourly reward to get a example.

    Good luck.

    • Upvote 1
    • Like 1
  6. 3 minutes ago, cumbe11 said:

    thank you very much.
    What would you look like with only fidelidade points?

    		if (@bought_nameid[@n] == .ItList[@a])
    		{
    			set @PriceT, .ItList[@a + 1] * @bought_quantity[@n];
    		
    			if (#fidelidade < @PriceT)
    			{
    				end;
    			}
    			else
    			{
    				set #fidelidade, #fidelidade - @PriceT;
    
    				getitem @bought_nameid[@n], @bought_quantity[@n];
    			}
    		}

     

    • Upvote 1
  7. Here is the problem:

    Spoiler
    
    	OnBuyItem:
        for(set @n,0;@n<getarraysize(@bought_nameid);set @n,@n+1)
            for(set @a,0;@a<getarraysize(.ItList);set @a,@a+2)
                if(@bought_nameid[@n]==.ItList[@a]){
                    set @PriceT,.ItList[@a+1]*@bought_quantity[@n];
                        if(#fidelidade){ if(#fidelidade<@PriceT) end; }else{ if(Zeny<@PriceT) end; }
                        getitem @bought_nameid[@n],@bought_quantity[@n];
                        if(#fidelidade) set #fidelidade,#fidelidade-@PriceT; else set Zeny,Zeny-@PriceT;
                }
        end;

     

    The script are checking if player have '#fidelidade' or 'Zeny' and if have one of them, will give the item.

    So you need to change only to check '#fidelidade' points or '#fidelidade' points and 'Zeny'.

    Like this:

    Spoiler
    
    		if (@bought_nameid[@n] == .ItList[@a])
    		{
    			set @PriceT, .ItList[@a + 1] * @bought_quantity[@n];
    		
    			if (#fidelidade < @PriceT)
    			{
    				end;
    			}
    			else
    			{
    				set #fidelidade, #fidelidade - @PriceT;
    
    				getitem @bought_nameid[@n], @bought_quantity[@n];
    			}
    		}

     

     

    • Upvote 1
  8. 1 hour ago, Radian said:

    @Cretino Hi, i found a bug in the script, when an headgear is equipped with a card on it, and it successfully enchant it the card compound is gone.

    nevermind bro, i found what's the problem.

    Yes, I saw the problem, I was using one variable not declared. ('@char[0]', '@char[1]' instead of '.@char[0]', '.@char[1]')

    You guys need change this:

    Spoiler
    
    getitem2 .@equip, 1, 1, .@refine, 0, @cards[0], @cards[1], (.@selected_slot == 1) ? .gemstones[.@selected_gemstone - 1] : .@enchants[0], (.@selected_slot == 2) ? .gemstones[.@selected_gemstone - 1] : .@enchants[1];

     

    To:

    Spoiler
    
    getitem2 .@equip, 1, 1, .@refine, 0, .@cards[0], .@cards[1], (.@selected_slot == 1) ? .gemstones[.@selected_gemstone - 1] : .@enchants[0], (.@selected_slot == 2) ? .gemstones[.@selected_gemstone - 1] : .@enchants[1];

     

    And this:

    Spoiler
    
    getitem2 .@equip, 1, 1, .@refine, 0, @cards[0], @cards[1], (.@selected_enchant == 1) ? 0 : .@enchants[0], (.@selected_enchant == 2) ? 0 : .@enchants[1];

     

    To:

    Spoiler
    
    getitem2 .@equip, 1, 1, .@refine, 0, .@cards[0], .@cards[1], (.@selected_enchant == 1) ? 0 : .@enchants[0], (.@selected_enchant == 2) ? 0 : .@enchants[1];

     

    Thanks to notify me.

    • Like 1
  9. 1 hour ago, Radian said:

    Uh, let's say every time a player used the npc to enchant, it will start counting until it reaches the limit of usage

    .usage_limit = 100;

    Then npc will only disable the enchantment part, not the remove enchantment.

    I hope i explained it very well.

    I think is it you want:

    new_item_enchanter_v1.1.txt

    You can go to line '364' to configure it and see more for changes.

    • Upvote 2
  10. 11 minutes ago, Radian said:

    @Cretino I've tested the script, and its working 100%. I just wanted to change some things on it.

    1. The `ENCHANT_DELAY` change it to npc usage not for player.
      • When the whole server used the npc 100 times it will be disabled.

    You want to put delay after enchant and add npc usage limit?

    If you want enchant delay, you want for account or character or global?

    After NPC reaches 100 usages, players can remove enchantments or disable completely the npc?

  11. 14 hours ago, Radian said:

    I've been looking in the forum before making this request topic, about the item enchanter.

    to be specific about my request;

    1. Player can only select the 3/third and last slot from item.
    2. Player can only select the upper headgear.
    3. Requirements:
      • Stone/Gemstone ID#
      • Additional requirements Item + Zeny.
    4. Player can removed the stone/gemstone.
      1. Payments options:
        • Zeny
        • Coin
    5. Rates of success are [slot_3 = 10~15% chance of success / slot_4 = 5~10% chance of success]
    6. Players cant enchant the same stone/gemstone in the same headgear.
    7. If it fails the item will stay, but the stone/gemstone will be deleted from the players inventory.
    8. Add limit per day for the npc to enchant an item. resets the limit (OnClock0000:); 

    here's a sample of the configuration.

    
    // Gemstone/Stone ID's
    setarray .gemstoneid, 601,602,603,604,605;
    
    // Additional requirements
    // or set 0 to disable
    setarray .add_items, 501,10,502,3,503,7,504,9,505,99;
    
    // Will the npc allow players
    // to remove gemstone/stone
    // in their headgear?
    // 0 = disable
    // 1 = enable (default
    .allow_remove = 1;
    
    // Payments for removing
    // enchantments (stone/gemstone)
    .zeny = 1000;
    .coinid = 671;
    
    // Rate Success
    .Slot3 = rand(10,15);
    .Slot4 = rand(5,15);
    
    // If the enchantment fails
    // will it be deleted?
    // 1 = only the stone/gemstome (default)
    // 2 = only the headgear
    // 3 = all (stone/gemstone + headgear)
    .deleteitem = 1;

    So far that's all what im thinking, but everyone can add something to my idea.

    I think is it you want:

    new_item_enchanter_v1.0.txt

    I've tested and is working well...

    You can go to line '347' to configure it.

    Sorry for my English. ?

    • Love 1
  12. Hey guys, try this:

    Change this part:

    Spoiler
    
    OnPoripori:
    	instance_announce .@i,"Pori Pori: What..... what is happening?  How could I..... lose.....",bc_map,0xFFD700;
    	sleep 5000;
    	instance_announce .@i,"Pori Pori: I'll return when I've healed, then..... then you'll all suffer!!!",bc_map,0xFFD700;
    	enablenpc instance_npcname("EC_Arc_Pori", instance_id());
    	sleep 15000
    	getpartymember getcharid(1),2;
    	for( set .@i, 0; .@i < $@partymembercount; set .@i, .@i+1 )
    		if( attachrid( $@partymemberaid[.@i] ) && EC_INSTANCE_ID > 0){
    			set EC_INSTANCE_ID, -1;
    		}
    	instance_destroy instance_id();
    	end;

     

    To:

    Spoiler
    
    OnPoripori:
    	set .@failed, true;
    
    	if (playerattached() != 0)
    	{
    		getpartymember getcharid(1), 2;
    		set .@failed, false;
    	}
    
    	instance_announce .@i,"Pori Pori: What..... what is happening?  How could I..... lose.....",bc_map,0xFFD700;
    	sleep 5000;
    	instance_announce .@i,"Pori Pori: I'll return when I've healed, then..... then you'll all suffer!!!",bc_map,0xFFD700;
    	enablenpc instance_npcname("EC_Arc_Pori", instance_id());
    	sleep 15000;
    
    	if (.@failed == false)
    	{
    		for(set .@i, 0; .@i < $@partymembercount; set .@i, .@i + 1)
    		{
    			if (attachrid($@partymemberaid[.@i]) == true)
    			{
    				if (EC_INSTANCE_ID > 0)
    				{
    					set EC_INSTANCE_ID, -1;
    					detachrid;
    				}
    			}
    		}
    	}
    
    	instance_destroy instance_id();
    	end;

     

    I've not tested, but probably will work.

    • MVP 1
  13. Actually, I'm riding a "Hardcore Mode" system.

    It's working, I plan to post later.

    It even manages to identify the uses of commands to kill players and avoids the same.

    Thus, the player can only be killed by another player or monsters and delete it if you added the option.

     

    I'm still doing some modifications.

    Putting "advantages" to play in the "HardCore Mode".

     

    PS: I'm using google translator.

×
×
  • Create New...