Jump to content

Yami

Members
  • Posts

    111
  • Joined

  • Last visited

Posts posted by Yami

  1. Hi there, I've been trying to modify my lotti script into not have a default prize (If you lose you get this item).

    I just want a Lotti / Gacha script that will take the payment, then randomly select a reward (items that I set) with their respective chances.

    As my current lotti script goes (the one from rathena) when you roll and if you don't get any of the set rewards you will be rewarded with a DEFAULT prize. I don't want to get default prize, I just want to get the items that are set by how high the chance to get them.

    Just roll me all the items, highest chance to lowest chance. Thank you for the help

    This is the script

    // http://rathena.org/board/topic/83017-pro-lotti-girl-refine-master/
    turbo_room,135,97,3	script	Lotti Girl	720,{
    	mes "[Lotti Girl]";
    	mes "I'm Lotti! I'll exchange";
    	mes "Random Prizes for every";
    	mes "^ff000050,000 zeny^000000.";
    	next;
    	mes "[Lotti Girl]";
    	mes "Our Grand prize is:";
    	mes "^ff0000 +4 Refine Ticket^000000";
    	mes "Consolations are:";
    	mes "^ff0000 x1 Silver Coin^000000";
    	mes "^ff0000 x1 Bronze Coin^000000";
    	mes "^ff0000 x?? War Badges^000000";
    	mes "And many more!!";
    	if (Zeny < 50000)
    		close;
    	next;
    	if(select("Let's Do This!!:No thanks...")==2) close;
    	mes "[Lotti Girl]";
    	mes "Here we go...";
    	set Zeny, Zeny - 50000;
    	set .@Total,5;
    	//<%>,<ItemID>,<Amount>
    	setarray .@P1[0],2,6456,1;
    	setarray .@P2[0],3,675,1;
    	setarray .@P3[0],4,673,1;
    	setarray .@P4[0],5,7773,rand(1,2);
    	setarray .@Default[0],11502,rand(1,3);
    	set .@i, rand(1,.@Total);
    	if (rand(1,100) > getd(".@P"+.@i+"[0]"))
    	{
    		for(set .@j,0; .@j<getarraysize(.@Default); set .@j,.@j+2)
    		{
    			getitem .@Default[.@j], .@Default[.@j+1];
    			if(!.@k[0])
    				setarray .@k[0], .@Default[.@j], .@Default[.@j+1];
    		}
    	}
    	else{
    		for(set .@j,1; .@j<getarraysize(getd(".@P"+.@i)); set .@j,.@j+2)
    		{
    			getitem getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]");
    			if (!.@k[0])
    			{
    				set .@gz,.@i;
    				setarray .@k[0], getd(".@P"+.@i+"["+.@j+"]"), getd(".@P"+.@i+"["+(.@j+1)+"]");
    				break;
    			}
    		}
    	}
    	if(1<=.@gz&&.@gz<=2)
    		announce "Hey! "+strcharinfo(0)+" just received "+getitemname(.@k[0])+" x "+.@k[1]+" from Lotti Girl!",0;
    	specialeffect2 248;
    	close;
    }

     

  2. Bumping this request

    Okay I found this piece of script in herc forums which is basically almost identical to what I need. But the script is incomplete, and I can't make it to work properly.

    So far I've managed it to check for Knight Classes in a guild, when inside WOE castle. But the script is kicking out every one of them even before hitting the target limit. Can someone help me fix this script? Please

    -	script	ckeckguildjob	-1,{
    {
    OnPCLoadMapEvent:
    getguildmember(getcharid(0),2);
    set .@guildids[0],$@guildmembercid[0],$@guildmembercount;
    set .@count, $@guildmembercount;
    for (set .@a, 0; .@a < .@count;
    set .@a, .@a + 1)
    attachrid .@partyids[.@a];
    set .@jobs[.@a], 4008;// Check Job from other current jobs
    for (set .@b, 0; .@b < getarraysize(.@jobs); 
    set .@b, .@b + 1)
    if (Class == .@jobs[.@b]) {
    set .@matches, .@matches + 1;
    if (.@matches > 1) // Too many knights made it limit of 1 for testing purposes but will be 8
            dispbottom "There can only be 8 Knight per guild members inside a castle during woe.";
            warp "SavePoint",0,0;
    set .@matches, 0;
    }
    }
    OnInit:
    	setarray .castles$[0],
    		"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
    		"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
    		"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
    		"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
    		"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
    		"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
    	for ( .@i = 0; .@i < 30; .@i++ )
    		setmapflag .castles$[.@i], mf_loadevent;
    	end;
    }

     

  3. Hey there everyone! I can't seem to find any script regarding this request, but I know it exists for I've seen it in a couple servers that I've played recently.

    I'm looking for a script that Limits a job class' specific count per guild inside WOE castles.

    In example, Only 5 Knight class are allowed inside the castle per guild, If a guild has 6 online knights inside the castle from ECALL, OR a 6th knight enters the castle the whole guild will be warped out to their savepoint.

    As long as they go pass the 5 limit for whatever job that has it, the whole guild should be warped out of the castle. Thank you! Any information will be helpful.

     

    Edit:

    Okay I found this piece of script in herc forums which is basically almost identical to what I need. But the script is incomplete, and I can't make it to work properly.

    So far I've managed it to check for Knight Classes in a guild, when inside WOE castle. But the script is kicking out every one of them even before hitting the target limit. Can someone help me fix this script? Please.

    -	script	ckeckguildjob	-1,{
    {
    OnPCLoadMapEvent:
    getguildmember(getcharid(0),2);
    set .@guildids[0],$@guildmembercid[0],$@guildmembercount;
    set .@count, $@guildmembercount;
    for (set .@a, 0; .@a < .@count;
    set .@a, .@a + 1)
    attachrid .@partyids[.@a];
    set .@jobs[.@a], 4008;// Check Job from other current jobs
    for (set .@b, 0; .@b < getarraysize(.@jobs); 
    set .@b, .@b + 1)
    if (Class == .@jobs[.@b]) {
    set .@matches, .@matches + 1;
    if (.@matches > 1) // Too many knights made it limit of 1 for testing purposes but will be 8
            dispbottom "There can only be 8 Knight per guild members inside a castle during woe.";
            warp "SavePoint",0,0;
    set .@matches, 0;
    }
    }
    OnInit:
    	setarray .castles$[0],
    		"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
    		"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
    		"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
    		"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
    		"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
    		"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
    	for ( .@i = 0; .@i < 30; .@i++ )
    		setmapflag .castles$[.@i], mf_loadevent;
    	end;
    }

     

  4. 1 hour ago, Skorm said:

    Ahh yeah I see what they meant by that now sorry about that. I blame crappy documentation.

    Haha! All good! I did not understand that myself until recently. Thanks for your help it's working as intended now.

  5. On 6/13/2021 at 9:10 PM, Skorm said:

    Ahh yeah I forgot that .@party_id was no longer being set. Anyways the way you have it now will not work right since warpparty is within the for loop. In my example it is outside the for loop and will only get run once as it should. Also I've modified my original post with the corrected script segment.

    Oh! I will try this right now! Thank you @Skorm. I'll update this thread 

     

    @Skormscript is now working as intended!! Thanks a lot! 

    I had to modify the range 500,500 to 1,1 so they all stick together and +500 coordinate made it spawn to a random spot because of invalid coordinates. Thanks again! 

    On 6/12/2021 at 11:36 PM, Skorm said:

    warpparty "Leader",0,0,getcharid(1),"pvp_y_1-2",500,500;

     

  6. On 6/12/2021 at 11:36 PM, Skorm said:
    	setarray .@town_maps$, "prontera", "izlude", "geffen", "morroc";
    	if(getpartyleader(getcharid(1),2) == getcharid(0)) {
    		getpartymember getcharid(1), 1;
    		getpartymember getcharid(1), 2;
    		for ( .@i = 0; .@i < $@partymembercount; .@i++ )
    			if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
    				if(inarray(.@town_maps$, strcharinfo(3,$@partymembercid[.@i])) > -1)
    					warp "pvp_y_1-2",0,0,$@partymembercid[.@i];
    		warpparty "Leader",0,0,.@party_id,"pvp_y_1-2",500,500;	
    	}

     

    Thanks @Skorm I will try this script in a little bit!

    @Skorm the script not working as intended,  sorry I should've explained it better. My npc script argument goes like this

    1. Check if player is party leader (Only party leader can warp his team into pvp room, hence party leader check in the beginning)

    2. If player is a party leader, warp his party (Like Emergency Call they all warp together) inside pvp room BUT if his party member is not in a town (maybe already inside pvp room, dungeons or somewhere else) they will not be warped with the team going inside pvp room. So restrict warping of members to only who are in a town.

    ****This is kinda tricky tho, because I have to warp the party leader inside the pvp room first, then warpparty the rest of the members into his position (which is random). Otherwise they will be all in random places inside the pvp room. So I modified the script you provided a little bit to do this just like my first script. And here's the updated script but it's not warping any party member anymore, I'm kinda confused.

     

    		case 3:
    			if (is_party_leader() == true) { //Check if leader
    			setarray .@town_maps$, "prontera", "izlude", "geffen", "morroc";
    				if(getpartyleader(getcharid(1),2) == getcharid(0)) {
    				getpartymember getcharid(1), 1;
    				getpartymember getcharid(1), 2;
    					for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
    						if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
    							if(inarray(.@town_maps$, strcharinfo(3,$@partymembercid[.@i])) > -1)
    							.@party_id = getcharid(1);
    							warp "pvp_y_1-2",0,0; //Warp the leader first
    							warpparty "Leader",0,0,.@party_id,"pvp_y_1-2",500,500; //Warp the rest to the leader position
    							}
    					}
    				}
    
    			
    			}// If leader end
    
    			//If not leader
    			mes "You are Not a Party Leader";
    			close;

    The script is warping the leader, but not the rest of the party anymore. Which works fine from my original script (Warp leader, then warp members to him)

  7. Hi there, I have this heavily modified PVP warper script which I added a Party vs Party feature. But I need help to only warp party members if they are on town map. Here's the party warp script:

    if (is_party_leader() == true) {
    				if(getpartyleader(getcharid(1),2) == getcharid(0)) {
      				getpartymember getcharid(1), 1;
      				getpartymember getcharid(1), 2;
      				for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
        					if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
    					attachrid $@partymemberaid[.@i];
    					.@party_id = getcharid(1);
    					warp "pvp_y_1-2",0,0;
    					warpparty "Leader",0,0,.@party_id;
        					}
      				}
    				}
    			
    			}// If leader close

    Can someone help me add a restriction to only warp members that are in town map.

  8. 50 minutes ago, Foob said:

    Not sure but try this.

    Find SC_ANKLE in skill_block_check, add sc_end for the critical explosion and add check skill_id for body reloc + sc status of critical explosion.

    I'm sorry but I have next to no clue how to do this, src is not really my strong point :<

  9. Is it possible for ankle snare to remove Monk/Champ Critical Explosion Status when player steps on trap (Ankle Snare)? This is to prevent spamming body relocation on top of traps during WOE. In a sense that, they would have to re-cast critical explosion to be able to use body relocation with no sphere usage after stepping into a trap. If so, can someone please help me to edit my trap effect. Server is pre-renewal.

  10. Hi there, I'm having this issue when I manually use Volcanic Ash and Lava Slide on the ground, I get an error saying "There is no target in attack range vicinity. Please use 'ALT + RIGHT CLICK' to command homunculus to attacks a target."

    I remember you should be able to cast this on the ground even without a target. How to Fix this?

     

    Settings on skill_db is set to target ground, so I do not understand why I won't work.

    8041,7,6,2,3,0x2,0,5,1,no,0,0,1,weapon,0,0x0,		MH_LAVA_SLIDE,Lava Slide
    8043,7,6,2,0,0x1,0,5,1,no,0,0,3,none,0,0x0,		MH_VOLCANIC_ASH,Volcanic Ash

     

  11. 12 hours ago, jurelmetal said:

    Fixed script:

    
    -	script	Monster_Drop	-1,{
    OnNPCKillEvent:
    //if(getgmlevel()>50) end;
    
    // MVP DROP
    if ( getmonsterinfo( killedrid, 22 ) ) {
    set #daily_mvp,#daily_mvp + 1;
    	for ( .@i = 0; .@i < getarraysize( .items ); .@i += 4 ) {
    		if ( rand( 100 ) < .items[ .@i +  3 ] ) {
    			.@quantity = rand(.items[.@i + 1], .items[.@i + 2]); // Use the numbers as arguments to the call to rand(a, b)
    			getitem .items[.@i], .@quantity;
    			//announce strcharinfo(0)+" got "+getitemname( .items[ .@i ] )+" x"+.@quantity+" from "+getmonsterinfo(killedrid, 0)+"!!",bc_all,0xFFFFFF;
            }
        }
    }
    // NORMAL MOB DROPS
    else {
    	for ( .@i = 0; .@i < getarraysize( .mobitem ); .@i += 4 ) {
    		if ( rand( 100 ) < .mobitem[ .@i +  3 ] ) {
    			.@quantity = rand(.mobitem[.@i + 1], .mobitem[.@i + 2]); // Use the numbers as arguments to the call to rand(a, b)
    			getitem .mobitem[.@i], .@quantity; 
            }
        }
    }
    end;
    
    OnInit:
    // Random amount 6240,rand(1,3),1,
    // MVP ITEMS	<item id>,<min_amount>,<max_amount>,<chance>
    //setarray .items[0],673,5,10,675,1,1,7859,20,5;
    setarray .items[0],
      673,5,5,10,
      675,1,1,1,
      7859,10,20,10;
    
    // MOB ITEMS	<item id>,<min_amount>,<max_amount>,<chance>
    //setarray .mobitem[0],7859,rand(1,10),5;
    setarray .mobitem[0],
      7859,1,5,5;
    end;
    
    } // END OF SCRIPT

    This way you should be able to add items to the arrays at the end without trouble. I don't have a setup to test right away but will post update if I find any issue.

    Script worked as intended! Thank you very much!

  12. I think I know the issue, I did some testing myself. I believe it comes from the MVP drops line, since I added more items to the array, I think I get an error when it tries to trigger 2nd or 3rd item drop. I've only been getting the Bronze Coin (673,5,5,10).

    Anyone know how I can add more items without getting any error? Please?

  13. @jurelmetal I'm getting this error on my Map server. Do you know why?

    KaYAL2y.png

     

    Here's my updated script:
     

    
    -	script	Monster_Drop	-1,{
    OnNPCKillEvent:
    //if(getgmlevel()>50) end;
    
    // MVP DROP
    if ( getmonsterinfo( killedrid, 22 ) ) {
    set #daily_mvp,#daily_mvp + 1;
    	for ( .@i = 0; .@i < getarraysize( .items ); .@i += 3 ) {
    		if ( rand( 100 ) < .items[ .@i +  2 ] ) {
    			getitem .items[.@i], rand(.items[.@i + 1], .items[.@i + 2]); // Use the numbers as arguments to the call to rand(a, b)
    			//announce strcharinfo(0)+" got "+getitemname( .items[ .@i ] )+" x"+.items[ .@i + 1 ]+" from "+getmonsterinfo(killedrid, 0)+"!!",bc_all,0xFFFFFF;
    			}
    		}
    	}
    // NORMAL MOB DROPS
    else {
    	for ( .@i = 0; .@i < getarraysize( .mobitem ); .@i += 3 ) {
    		if ( rand( 100 ) < .mobitem[ .@i +  2 ] ) {
    			getitem .mobitem[.@i], rand(.mobitem[.@i + 1], .mobitem[.@i + 2]); // Use the numbers as arguments to the call to rand(a, b)
    			}
    		}
    	}
    end;
    
    OnInit:
    // Random amount 6240,rand(1,3),1,
    // MVP ITEMS	<item id>,<amount>,<chance>
    //setarray .items[0],673,5,10,675,1,1,7859,20,5;
    setarray .items[0],673,5,5,10,675,1,1,1,7859,10,20,10;
    
    // MOB ITEMS	<item id>,<amount>,<chance>
    //setarray .mobitem[0],7859,rand(1,10),5;
    setarray .mobitem[0],7859,1,5,5; // sets 1 as the minimum amount and 10 as the max
    end;
    
    } // END OF SCRIPT

     

  14. 36 minutes ago, jurelmetal said:

    To add more items just add more sets of 4 values in your array. (item ID, min qty, max qty, chance)

    Certainly my suggestions assumes that you're going to randomize the quantity for all items in the array. If you don't want this, you can set both values to the same number for that item.

    Hope that helps!

    Aight, will try this as soon as I can. Thank you

  15. 34 minutes ago, jurelmetal said:

    You are executing the rand() at OnInit, so it only runs when the server starts.

    You should store both min and max amounts in the array, and run the rand() inside the OnNPCKillEvent label with those stored values to get the effect you want:

    At OnInit:

    
    setarray .mobitem[0],7859,1,10,5; // sets 1 as the minimum amount and 10 as the max

    At OnNPCKillEvent:

    
    // ... your code ...
    getitem .items[.@i], rand(.items[.@i + 1], .items[.@i + 2]); // Use the numbers as arguments to the call to rand(a, b)

    Also remember to modify your loop so that it adds 4 instead of 3 to .@i on each iteration.

    Should I change my code into this @jurelmetal? What about when I add more Items? Or just have it on a fixed amount because I probably wont randomize the amount of all the items the I put as drops.

    I'm not entirely sure, but the old script works back then, with all the rand(1,123) on the code, but now it's not working.

  16. Hi there, I've been using this script in the past and just tried to use it again. But it seems some of the scripts are not working as they did before, mainly the getitem random amount is not working. It will only give a fixed amount even set at random.

    Can someone check it out please?

     

    Here's the script:
     

    -	script	Monster_Drop	-1,{
    OnNPCKillEvent:
    //if(getgmlevel()>50) end;
    
    // MVP DROP
    if ( getmonsterinfo( killedrid, 22 ) ) {
    set #daily_mvp,#daily_mvp + 1;
    	for ( .@i = 0; .@i < getarraysize( .items ); .@i += 3 ) {
    		if ( rand( 100 ) < .items[ .@i +  2 ] ) {
    			getitem .items[ .@i ], .items[ .@i + 1 ];
    			//announce strcharinfo(0)+" got "+getitemname( .items[ .@i ] )+" x"+.items[ .@i + 1 ]+" from "+getmonsterinfo(killedrid, 0)+"!!",bc_all,0xFFFFFF;
    			}
    		}
    	}
    // NORMAL MOB DROPS
    else {
    	for ( .@i = 0; .@i < getarraysize( .mobitem ); .@i += 3 ) {
    		if ( rand( 100 ) < .mobitem[ .@i +  2 ] ) {
    			getitem .mobitem[ .@i ], .mobitem[ .@i + 1 ];
    			}
    		}
    	}
    end;
    
    OnInit:
    // Random amount 6240,rand(1,3),1,
    // MVP ITEMS	<item id>,<amount>,<chance>
    setarray .items[0],673,5,10,
    			675,1,1,
    			7859,20,5;
    
    // MOB ITEMS	<item id>,<amount>,<chance>
    setarray .mobitem[0],7859,rand(1,10),5;
    			//7859,5,1;
    end;
    
    } // END OF SCRIPT

     

    Looking forward to getting the script work as intended again. Thank you!

  17. @Emistry, Hi sorry for the ping. But one more thing, Can we add an effect on the NPC when someone is inside any of the PVP rooms? Like the woe_controller script that makes the npc glow when WOE is active. Something like that.

    I looked at that script and got this part, but I'm not sure how to integrate it with this pvp script. Can help please?

     

    Something like this, but when players are inside any of the rooms instead of when WOE is active.
     

    OnAgitStart:
    	while(agitcheck()) {
    		specialeffect EF_BEGINSPELL6;
    		sleep 425;
    	}
    	end;

     Edit:
    This is to make players know that people are inside PVP room since we removed the "Entered PVP Room" announcement.

  18. Tried the changes but the limit doesn't seem to work? I tried changing it to 1/1 to test it, then warp another character. And it still warped inside. @Patskie any idea why bro?

     

    22 hours ago, Emistry said:

    try this

    
    prontera,155,181,5	script	PVP Warper::pvp	946,{
    
    	OnInit:
    		setarray .map_name$, "Epsilon Arena", "Square Arena", "Sandwich Arena", "Prontera Arena";
    		setarray .map$, "guild_vs1", "guild_vs3", "pvp_n_8-1", "pvp_y_1-1";
    		setarray .map_max_player, 15, 20, 30, 60;
    		.map_size = getarraysize(.map$);
    		end;
    		
    	while(1) {
    		mes "["+strnpcinfo(0)+"]";
    		.@menu$ = "";
    		for (.@i = 0; .@i < .map_size; .@i++)
    			.@menu$ = .@menu$ + sprintf("%s [ %d / %d ]", .map_name$[.@i], getmapusers(.map$[.@i]), .map_max_player[.@i]) + ":";
    		.@i = select(.@menu$) - 1;
    		if (.map_max_player[.@i] && getmapusers(.map$[.@i]) >= .map_max_player[.@i]) {
    			mes "This map is currently full.";
    			next;
    		}
    		else {
    			warp .map$[.@i], 0, 0;
    			end;
    		}
    	}
    	close;
    }

     

    Thank you Emistry, will try this as soon as I can.

     

    Thank you @Emistry. Script worked perfectly! Thank you much!

×
×
  • Create New...