Jump to content

SpiritD

Members
  • Posts

    75
  • Joined

  • Last visited

Posts posted by SpiritD

  1. I can do this -- give me a little time (at work right now)

    /edit/ Okay so I realize now you need to make your own custom item "box". For example, player will buy the 10 count berry box for 2 TCG, open the box and get 10 berry. I'll give you my shop code but it's nothing special... you will need to create your own item ID for the box and put it into this script.

    MAP,X,Y,Z	script	YGG Trader#spiritD	SPRITE,{
    
    	mes "[YGG Trader]";
    	mes "Would you like to buy some";
    	mes "yggdrasil items?";
    	if (countitem(7227) < 1) {
    		mes "I only accept TCG Card as payment.";
    		mes "Please come back when you have TCG Cards.";
    		close;
    	}
    	switch(select("No:Yes")){
    	case 1:
    		close;
    	case 2:
    		callshop "YGG_SHOP",1;
    		end;
    	}
    
    }
    -	itemshop	YGG_SHOP	-1,7227,<itemid>:<price>,<itemid>:<price>

     

  2. On 9/17/2017 at 12:06 AM, sader1992 said:

    i don't know about this command but if you use script and make a (bindatcmd) in the script and hook the script with timer and in the timer the greed skill 

    dose this do what you need O.O ?

    didn't try that i think it may do the animation (and you don't want that)?

    Hey that might work temporarily but what I want to do is:

    When you pick up an item it's just that one item. I want to change it so when you pick up an item, it picks up all the items in a 3x3 radius (just like greed but automatically). The @command will be so you can turn it on or off.

  3. Spoiler
    ---------------------------------------
       
      *vip_status(<type>,{"<character name>"})
       
      Returns various information about a player's VIP status.
       
      Valid types:
      VIP_STATUS_ACTIVE - VIP status: true if the player is a VIP or false if not
      VIP_STATUS_EXPIRE - VIP expire timestamp if the player is VIP or 0 if not
      VIP_STATUS_REMAINING - VIP time remaining in seconds
       
      NOTE: This command is only available if the VIP System is enabled.
       
      ---------------------------------------
       
      *vip_time <time>,{"<character name>"};
       
      Changes a player's VIP time (in minutes). A positive value will increase time, and a
      negative value will decrease time.
       
      NOTE: This command is only available if the VIP System is enabled.
       
      ---------------------------------------

    source: https://github.com/rathena/rathena/blob/master/doc/script_commands.txt

  4. Change

    switch(basejob)

    to

    switch(Class)

    *Note: I think it's case sensitive so you might have to change the other variables near the bottom of the script. Refer to the pre-defined character variables here:

    Spoiler
    Zeny - Amount of Zeny.
      Hp - Current amount of hit points.
      MaxHp - Maximum amount of hit points.
      Sp - Current spell points.
      MaxSp - Maximum amount of spell points.
      StatusPoint - Amount of status points remaining.
      SkillPoint - Amount of skill points remaining.
      BaseLevel - Character's base level.
      JobLevel - Character's job level.
      BaseExp - Amount of base experience points.
      JobExp - Amount of job experience points.
      NextBaseExp - Amount of base experience points needed to reach the next level.
      NextJobExp - Amount of job experience points needed to reach the next level.
      Weight - Amount of weight the character currently carries.
      MaxWeight - Maximum weight the character can carry.
      Sex - 0 if female, 1 if male.
      Class - Character's job.
      Upper - 0 if the character is a normal class, 1 if advanced, 2 if baby.
      BaseClass - The character's 1-1 'normal' job, regardless of Upper value.
      For example, this will return Job_Acolyte for Acolyte, Priest/Monk,
      High Priest/Champion, and Arch Bishop/Sura. If the character has not
      reached a 1-1 class, it will return Job_Novice.
      BaseJob - The character's 'normal' job, regardless of Upper value.
      For example, this will return Job_Acolyte for Acolyte,
      Baby Acolyte, and High Acolyte.
      Karma - The character's karma. Karma system is not fully functional, but
      this doesn't mean this doesn't work at all. Not tested.
      Manner - The character's manner rating. Becomes negative if the player
      utters words forbidden through the use of 'manner.txt' client-side
      file.

     

  5. 1 hour ago, Tokei said:

    As the error mentions, the function (mobcount) doesn't have enough argument: *mobcount("<map name>","<event label>"). Refer to: https://github.com/rathena/rathena/blob/d770de8015afd31be89e1b125a8c3615a0453f88/doc/script_commands.txt#L5974 for more info.

     

    Thank you. I have fixed the NPC error but there must be another error in the logic somewhere. When I choose "solo" (or any other option) the map-server crashes. What gives? (ps- I went ahead and defined the instance in the instance_db.txt)

  6. Hye guys, can someone tell me what's wrong with this script? The person who wrote it hasn't replied in a couple of days.

    //instance entrance
    prontera,153,31,2	script	Knight Tord#prtfild08Tord	418,{
    	mes "[ Knight Tord ]";
    	mes "Operations are going smoothly.";
    	switch(select("Thank you, sir.:Sir, may I join the operation?")){
    	case 1:
    		close;
    	case 2:
    		next;
    		mes "[ Knight Tord ]";
    		mes "===================";
    		mes "Level 10-15 - South Prontera.";
    		mes "===================";
    		mes "Are you sure?";
    		switch(select("Not sure.:Yes, I am ready!")){
    		case 1:
    			close;
    		case 2:
    			.@isntname$ = "prt_fild08";
    			switch(select("Solo:Party:Guild")){
    				case 1: .@mode$ = "IM_CHAR"; break;
    				case 2: .@mode$ = "IM_PARTY"; break;
    				case 3: .@mode$ = "IM_GUILD"; break;
    			}
    			switch(instance_create(.@isntname$, .@mode$)) {
    				case -1: mes "^FF0000-1 Invalid Type^000000.";
    				case -2: mes "^FF0000-2 Char/Party/Guild not exist^000000.";
    				case -3: instance_enter(.@isntname$); close;
    				case -4: mes "^FF0000-4 No Free Instances. MAX_INSTANCE?!^000000.";
    				default: break;
    			}
    			switch(instance_enter(.@isntname$)){
    			case 3:
    				mes "An unknown error has occurred.";
    				debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 3";
    				close;
    			case 2:
    				mes "Instance for " + .@isntname$ + " does not exist.";
    				mes "Instance has been destroyed by the Party Leader, or because of the time limit.";
    				debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 2";
    				close;
    			case 1:
    				mes "Looking for a party on a single char only instance..";
    				debugmes strcharinfo(0) + " / " + instance_id() + " / FAIL CODE 1";
    				close;
    			case 0:
    				end;
    			}
    		}
    	}
    }
    //monster spawn
    function	script	monster_spawn	{
    	switch(getarg(0)){
    		case 1:
    			instance_announce instance_id(),"50 Monsters spawned. Defeat them all to proceed.",0;
    			monster instance_mapname("prt_fild08"),169,366,"Poring",3000,1,instance_npcname("monster_death")+"::OnMobKill";
    			monster instance_mapname("prt_fild08"),171,365,"Poring",3000,1,instance_npcname("monster_death")+"::OnMobKill";
    			viewpoint 1,169,366,1,0xFFA7CB;
    			viewpoint 1,171,365,1,0xFFA7CB;
    			break;
    		case 2:
    			instance_announce instance_id(),"All 50 monsters killed! [Mastering] appeared!",0;
    			viewpoint 1,171,365,1,0xFF1B78;
    			monster instance_mapname("prt_fild08"),175,363,"Mastering [Boss]",1090,1,instance_npcname("monster_death")+"::OnBossKill";
    			break;
    	}
    	end;
    }
    //instance
    prt_fild08,172,373,2	script	Knight Tord#prtfld08Tord1	418,{
    	if('start > 1)
    		end;
    	mes "start?";
    	menu "Yes",-;
    	close2;
    	'start = 1; //instance variable
    	monster_spawn('start);
    	end;
    }
    prt_fild08,1,1,-1	script	monster_death	-1,{
    OnMobKill:
    	if(mobcount(instance_mapname("prt_fild08")) < 1){ //counts how many mobs are left, if 0 mobs remain, moves to next round
    		'start++;
    		monster_spawn('start);
    		end;
    	}
    OnBossKill:
    	instance_announce instance_id(),"Cogratulations",0;
    	getitem 501,1;
    	instance_destroy(instance_id());
    	end;
    }

    https://pastebin.com/SR5fR8f2

    When you chcoose "solo" or any other options the map server will crash. Does this have to be added to instance_db as well?

    21269742_10159255537785293_454069618_n.png

  7. 5 minutes ago, ItsFree said:

    yeah i understand that the only thing i dont understand is how to set the percents >< i guess is something about this

    
    if (.@winNum >= 0 && .@winNum <= 4)

    but i dont get it 

    https://www.mathsisfun.com/percentage.html

    The script is saying if "winning Number" is greater than or equal to zero AND less than or equal to 4 (meaning 0-4) then you win a prize. Because there are 100 different numbers that are picked  randomly, therefore your chances to get numbers 0-4 is 5%

  8. 6 minutes ago, ItsFree said:

    its ok i even if is more work "for me" set 1 by 1... its ok i'll do it, what i want is "between more controlable the percents better" what i want is 
    something like <prize_id>,#amount,<percent> if possible...

    im sure there is a cleaner way to do this but this should work:

    			.@winNum = rand(99);  //100
    			if (.@winNum >= 0 && .@winNum <= 4) { getitem <PRIZE_ID>,1; } //5% chance
    			if (.@winNum >= 5 && .@winNum <= 9) { getitem <PRIZE_ID>,1; } //5% chance
    			if (.@winNum >= 10 && .@winNum <= 19) { getitem <PRIZE_ID>,1; } //10% chance
    			if (.@winNum >= 20 && .@winNum <= 29) { getitem <PRIZE_ID>,1; } //10% chance
    			if (.@winNum >= 30 && .@winNum <= 49) { getitem <PRIZE_ID>,1; } //20% chance
    			if (.@winNum >= 50 && .@winNum <= 99) { getitem <PRIZE_ID>,1; } //50% chance
    			else { debugmes "[GamblerNPC] "+strcharinfo(0)+" is a hacker!!"; }

    Do you understand this example?

    • Like 1
  9. 4 minutes ago, ItsFree said:

    just that or have to edit something else ¿?

    you have it correct but there is one more thing to edit

    			.@winNum = rand(4);	//5 prizes to choose from (0-4)

    make sure the number is ONE LESS than the max amount of prizes so if you have 8 prizes the number inside the rand(#) will be 7 (because zero counts as one!)

     

    the percent would involve some tricky math but it's possible... like you want prize#1 to be rare, prize#2 to be uncommon, and all the rest be common? I could do that but you would have to set up all your prizes and what percent you want them (and they should add up to be 100% otherwise im gonna dunk you :P)

  10. 22 minutes ago, ItsFree said:

    the "point" can be get it from other npc for "point" you can use cashpoints i guess is an example what i mean for "point" ><

    MAP,X,Y,Z	script	GamblerNPC::spiritD	400,{
    
    	if(#CASHPOINTS == 0){
    		mes "You don't have enough points";
    		close;
    	}
    	if(#CASHPOINTS > 0){
    		mes "You have "+#CASHPOINTS+" cash points.";
    		mes "One roll costs 1 cash point.";
    		mes "Would you like to roll?";
    		switch(select("No thanks:Yes please")){
    		case 1:
    			close;
    		case 2:
    			#CASHPOINTS--;		//subtract CASHPOINTS by 1
    			.@winNum = rand(4);	//5 prizes to choose from (0-4)
    			if(.@winNum == 0){ getitem <PRIZE_ID>,1; }
    			if(.@winNum == 1){ getitem <PRIZE_ID>,1; }
    			if(.@winNum == 2){ getitem <PRIZE_ID>,1; }
    			if(.@winNum == 3){ getitem <PRIZE_ID>,1; }
    			if(.@winNum == 4){ getitem <PRIZE_ID>,1; }
    			else { debugmes "[GamblerNPC] "+strcharinfo(0)+" is a hacker!!"; }
    			mes "Congrats!";
    			close;
    		}
    	}
    }

    Fill in your own NPC coordinates and prizes /no1

  11. I tried this but I don't know how to do this part:

    3 hours ago, joker1992 said:

    then the npc show who the top 10 in the list with amount of item he/she find

     

    What I can do is make a script where the player gets "points" (in form of a variable) for turning in items but because I am not the best at scripting yet, you, as the admin, will have to manually look through each players points when the event is over - I don't know how to make a dynamic ladder

  12. I think I did it right .. though I don't have a lot of experience with timers yet. Basically I just attacked the GMstart and GMstop instructions with a cooldown variable and made a 2 hour timer outside the event to control it

    All customizations are labeled with '  //*EDIT:  '

    -	script	Bombring	-1,{
    OnInit:
    	set .eventstarted, 0;
    	set $bombring_reward,100;
    	bindatcmd "enablebombring","Bombring::OnGMStart";
    	bindatcmd "disablebombring","Bombring::OnGMStop";
    	hideonnpc "The Baaam#qz";
    	hideonnpc "Evento BombRing#prt";
    	end;
    	
    OnGMStart:
    	if (getgroupid() < 99){
    		dispbottom "You are not eligible for this command.", RED;
    		end;
    	}
    	if (.eventCooldown == 1) {//*EDIT:
    		dispbottom "You cannot start the event so soon.", RED; //*EDIT:
    		end; //*EDIT:
    	} //*EDIT:
    	set .eventstarted, 0;
    OnEventStart:
    	initnpctimer;
    	hideoffnpc "Evento BombRing#prt";
    	set .x, 5;
    OnTimer0000:
    	if (.eventstarted == 1) 
    		end;
    	announce "[BombRing]: O evento BombRing começou, vá em prontera para entrar!",bc_all;
    	sleep2 5000;
    	announce "[BombRing]: "+.x+" minutos para começar!",bc_all;
    	set .x, .x - 1;
    	end;
    OnTimer60000:
    OnTimer120000:
    OnTimer180000:
    OnTimer240000:
    	if (.eventstarted == 1) 
    		end;
    	announce "[BombRing]: "+.x+" minutos para o evento começar!",bc_all;
    	set .x, .x - 1;
    	end;
    OnTimer290000:
    	if (.eventstarted == 1) 
    		end;
    	announce "[BombRing]: 10 segundos para começar!",bc_all;
    	end;
    OnTimer300000:
    	if (.eventstarted == 1) 
    		end;
    	set .totalplayers, getmapusers ("quiz_02");
    	announce "[The Baaam]: "+.totalplayers+" jogadores entraram no evento!",bc_all;
    	announce "[The Baaam]: O evento começou!!",bc_all;
    	hideonnpc "The Baaam#prt";
    	stopnpctimer;
    	callsub OnEventStart1;
    	end;
    	
    OnEventStart1:
    	set .totalplayers, getmapusers ("quiz_02");
    	mapannounce "quiz_02","[BombRing]: Ok, escutem, é assim que funciona.",bc_all;
    	sleep 2000;
    	mapannounce "quiz_02","[BombRing]: Bombrings correrão desenfreados nesta área.",bc_all;
    	sleep 2000;
    	mapannounce "quiz_02","[BombRing]: e todos eles vão...BOOOOOOM!",bc_all;
    	sleep 2000;
    	mapannounce "quiz_02","[BombRing]: tudo o que você tem que fazer é ficar vivo :P",bc_all;
    	sleep 2000;
    	mapannounce "quiz_02","[BombRing]: Isso acontecerá por 30 segundos, em um total de 5 rounds.",bc_all;
    	sleep 2000;
    	mapannounce "quiz_02","[BombRing]: Entãoooo, prontos ou não ai vem eles!!!", bc_all;
    	
    	for (set .round,1;.round <= 5;set .round, .round + 1) {
    		set .totalplayers, getmapusers ("quiz_02");
    		callsub OnBombringSummon;
    		sleep 10000;
    	}
    
    	if (.round > 5 && getmapusers("quiz_02") > 0){
    		hideoffnpc "The Baaam#qz";
    		mapannounce "quiz_02","[BombRing]: Wooooow! Isso é raro! jogadores ganharam! :D",bc_all;
    	}
    	end;
    		
    OnBombringSummon:
    	mapannounce "quiz_02","[BombRing]: Round "+.round+"!!",bc_all;
    	set .eventstarted, 1;
    	initnpctimer;
    	while (.eventstarted == 1) {
    		if ( (3 * .totalplayers) <= 60)
    			areamonster "quiz_02",48,334,71,357,"Corra por sua vida!",1904,3 * .totalplayers;
    		else
    			areamonster "quiz_02",48,334,71,357,"Corra por sua vida!",1904,60;
    		
    		if(.round == 1) {
    			sleep 4000;
    		} else if (.round == 2) {
    			sleep 3000;
    		} else if (.round == 3) {
    			sleep 2000;
    		} else if (.round == 4) {
    			sleep 1500;
    		} else if (.round == 5) {
    			sleep 1000;
    		}
    	}
    	if (.eventstarted == 1)
    		mapannounce "quiz_02","[BombRing]: Round "+.round+" acabou!!",bc_all;
    	if (.round < 5)
    		mapannounce "quiz_02","[BombRing]: proximo round em 10 segundos.",bc_all;
    	return;
    	
    OnTimer31000:
    	if (.eventstarted == 0)
    		end;
    	else
    		set .eventstarted, 0;
    		killmonsterall "quiz_02";
    		cleanmap "quiz_02";
    	stopnpctimer;
    	end;
    	
    OnPCDieEvent:
    	if (strcharinfo(3) == "quiz_02") {
    		mapannounce "quiz_02","[BombRing]: "+strcharinfo(0)+" foi explodido!!",bc_all;
    		dispbottom "Você recebeu 1x [Ticket de Recompensa] por participar do evento.";
    		getitem 100,1;
    		warp "savepoint",0,0;
    		if (getmapusers("quiz_02") <= 1) {
    			stopnpctimer;
    			set .eventstarted, 0;
    			set .round, 6;
    			killmonsterall "quiz_02";
    			cleanmap "quiz_02";
    			hideoffnpc "The Baaam#qz";
    			mapannounce "quiz_02","[The Baaam]: Temos um vencedor!!",bc_all;
    		} 	
    	}
    	end;
    	
    OnGMStop:	
    	set .eventstarted, 0;
    	set .round, 6;
    	killmonsterall "quiz_02";
    	cleanmap "quiz_02";
    	hideoffnpc "The Baaam#qz";	
    	initnpctimer;  //*EDIT: start the cooldown timer
    	.eventCooldown = 1;  //*EDIT turn on cooldown message
    	end;
    	
    OnTimer720000:  //*EDIT: 2 hours
    	stopnpctimer; //*EDIT: stop timer
    	.eventCooldown = 0; //*EDIT turn off cooldown message
    }
    
    quiz_02,59,345,5	script	The Baaam#qz	1904,{
    mes "[^666699"+strnpcinfo(1)+"^000000]";
    mes "Mandou bem! Você é muito bom nisso!";
    next;
    
    mes "[^666699"+strnpcinfo(1)+"^000000]";
    mes "Você recebeu ^ff990010x [<ITEM>Moedas de Ouro<INFO>671</INFO></ITEM>]^000000 e ^ff99005x [<ITEM>Ticket's de Recompensa<INFO>100</INFO></ITEM>]^000000";
    getitem 671,10;
    getitem $bombring_reward,5;
    next;
    mes "[^666699"+strnpcinfo(1)+"^000000]";
    mes "Agora saia antes que você acabe explodindo!";
    next;
    atcommand "@go 0";
    end;
    }
    
    prontera,142,167,5	script	Evento BombRing#prt	879,{
    mes "[^666699The Baaam^000000]";
    mes "Olá!! gostaria de participar do evento Bombring?";
    Switch(Select("Sim!:Que evento é esse?:Não...")) {
    	case 1:
    		mes "[^666699The Baaam^000000]";
    		mes "Muito bem! esteja pronto!";
    		next;
    		warp "quiz_02",59,345;	
    		break;
    	case 2:
    		mes "[^666699The Baaam^000000]";
    		mes "Bem, tudo o que você tem que fazer é ficar vivo...";
    		mes "Isto é, esquivando das explosões dos ^00FF00Bombrings^000000!";
    		next;
    		mes "[^666699The Baaam^000000]";
    		mes "Se você ganhar:";
    		mes "^ff990010x [<ITEM>Moedas de Ouro<INFO>671</INFO></ITEM>]^000000";
    		mes "^ff99005x [<ITEM>Ticket's de Recompensa<INFO>100</INFO></ITEM>]^000000";
    		close;
    		break;
    	case 3:
    		mes "[^666699The Baaam^000000]";
    		mes "Tudo bem, volte se mudar de idéia!";
    		close;
    		break;
    	}
    end;
    
    OnInit:
    	hideonnpc "Evento BombRing#prt";
    }

     

  13. 6 hours ago, Kaze said:

    I made you a handy version of the script.

    SpiritD Simple PvP

    Thank you, Kaze. I knew someone with more experience than me would clean this up. I am just a beginner myself so I've been taking as many simple requests as I can... I guess this one wasn't as simple as I thought. You really lost me with the logic inside OnInit: - I see the loop that goes through the map list array but I don't understand how you used it for 

    	if( getd( "." + strcharinfo(3) ) == 1 ) {

     

×
×
  • Create New...