Jump to content
  • 0

Error on guild Buffer


LearningRO

Question


  • Group:  Members
  • Topic Count:  107
  • Topics Per Day:  0.02
  • Content Count:  770
  • Reputation:   69
  • Joined:  02/10/12
  • Last Seen:  

hi, all i got error like this when use script guild buffer
 

[Error]: script:run_script_main: infinity loop !

this is the script buffer

set y, 0;
	goto L_guildassumptio;
	

	L_guildassumptio:
			if ($guildassumptio[y]==getcharid(2)) goto L_buffassumptio;
				if (y>=getarraysize($guildassumptio)){
					set y, 0;
					goto L_guildmagnificat;
				}
			if (y<=getarraysize($guildassumptio)) set y,y+1;
			goto L_guildassumptio;
			end;

	L_buffassumptio:
			specialeffect(EF_ASSUMPTIO, AREA, playerattached()); sc_start SC_ASSUMPTIO,0,5;
			set y, 0;
			goto L_guildmagnificat;
			end;

	L_guildmagnificat:
			if ($guildmagnificat[y]==getcharid(2)) goto L_buffmagnificat;
				if (y>=getarraysize($guildmagnificat)){
					set y, 0;
					goto L_guildangelus;
				}
			if (y<=getarraysize($guildmagnificat)) set y,y+1;
			goto L_guildmagnificat;
			end;

	L_buffmagnificat:
			specialeffect(EF_MAGNIFICAT, AREA, playerattached()); sc_start SC_MAGNIFICAT,0,5;
			set y, 0;
			goto L_guildangelus;
			end;

	L_guildangelus:
			if ($guildangelus[y]==getcharid(2)) goto L_buffangelus;
				if (y>=getarraysize($guildangelus)){
					set y, 0;
					goto L_guildgloria;
				}
			if (y<=getarraysize($guildangelus)) set y,y+1;
			goto L_guildangelus;
			end;

	L_buffangelus:
			specialeffect(EF_ANGELUS, AREA, playerattached()); sc_start SC_ANGELUS,0,10;
			set y,0;
			goto L_guildgloria;
			end;

	L_guildgloria:
			if ($guildgloria[y]==getcharid(2)) goto L_buffgloria;
				if (y>=getarraysize($guildgloria)){
					set y, 0;
					goto L_guildimpositio;
				}
			if (y<=getarraysize($guildgloria)) set y,y+1;
			goto L_guildgloria;
			end;

	L_buffgloria:
			specialeffect(EF_GLORIA, AREA, playerattached()); sc_start SC_GLORIA,0,5;
			set y,0;
			goto L_guildimpositio;
			end;

	L_guildimpositio:
			if ($guildimpositio[y]==getcharid(2)) goto L_buffimpositio;
				if (y>=getarraysize($guildimpositio)){
					set y, 0;
					goto L_guildspirit;
				}
			if (y<=getarraysize($guildimpositio)) set y,y+1;
			goto L_guildimpositio;
			end;

	L_buffimpositio:
			specialeffect(EF_IMPOSITIO, AREA, playerattached()); sc_start SC_IMPOSITIO,0,5;
			set y,0;
			goto L_guildspirit;
			end;

	L_guildspirit:
			if ($guildspirit[y]==getcharid(2)) goto L_buffspirit;
				if (y>=getarraysize($guildspirit)){
					set y, 0;
					
				}
			if (y<=getarraysize($guildspirit)) set y,y+1;
			goto L_guildspirit;
			end;

	L_buffspirit:
			set y,0;
			percentheal 100,100;
			switch( Class ) {
			case Job_Star_Gladiator:
			case Job_Star_Gladiator2:
			set .@skill_id, 448; break;
			case Job_SuperNovice:
			set .@skill_id, 451; break;
			case Job_Soul_Linker:
			set .@skill_id, 461; break;
			case Job_Novice_High:
			case Job_Swordman_High:
			case Job_Mage_High:
			case Job_Archer_High:
			case Job_Acolyte_High:
			case Job_Merchant_High:
			case Job_Thief_High:
			set .@skill_id, 494; break;
	default:
			switch( BaseJob ) {
			case Job_Alchemist:    set .@skill_id, 445; break;
			case Job_Monk:        set .@skill_id, 447; break;
			case Job_Sage:        set .@skill_id, 449; break;
			case Job_Crusader:    set .@skill_id, 450; break;
			case Job_Knight:    set .@skill_id, 452; break;
			case Job_Wizard:    set .@skill_id, 453; break;
			case Job_Priest:    set .@skill_id, 454; break;
			case Job_Bard:
			case Job_Dancer:    set .@skill_id, 455; break;
			case Job_Rogue:        set .@skill_id, 456; break;
			case Job_Assassin:    set .@skill_id, 457; break;
			case Job_Blacksmith:    set .@skill_id, 458; break;
			case Job_Hunter:    set .@skill_id, 460; break;
			}
			break;
	}
	if (.@skill_id) {
		specialeffect(EF_SOULLINK, AREA, playerattached());
		sc_start4 SC_SOULLINK,350000,5,.@skill_id,0,0;        
		
	}

 

and this script for buy buffer 
 

prt_in,45,96,3	script	Guild Buffer	4_F_ARUNA_POP,{
	mes "[Guild Buffs]";
	if(getcharid(2)==0){
	mes "I'm sorry, I can only help you, if you're in a guild.";
	close;
	}
	mes "Hello, I offer buffs for guilds.";
	mes "Please select the buff you want to buy for your guild.";
	mes "The buffs you bought will be permanently available for your guild.";
	next;
	mes "[Guild Buffs]";
	mes "Guild Leaders can remove buffs by selecting to buy them and then confirming.";
	next;
	switch(select("Assumptio:Magnificat:Angelus:Gloria:Impositio Manus:Spirits")){
	case 1:
			set buff$, "Assumptio Level 5";
			set .@price, 10000;
			set buffon$, "assu";
			goto L_selectassumptio;
	case 2:
			set buff$, "Magnificat Level 5";
			set .@price, 5000;
			set buffon$, "magni";
			goto L_selectmagnificat;
	case 3:
			set buff$, "Angelus Level 10";
			set .@price, 5000;
			set buffon$, "angelus";
			goto L_selectangelus;
	case 4:
			set buff$, "Gloria Level 5";
			set .@price, 5000;
			set buffon$, "gloria";
			goto L_selectgloria;
	case 5:
			set buff$, "Impositio Manus Level 5";
			set .@price, 5000;
			set buffon$, "impo";
			goto L_selectimpositio;
	case 6:
			set buff$, "Spirits Level 4 (excluding Rebirth Spirit and Soul Linker Spirit)";
			set .@price, 10000;
			set buffon$, "spirit";
			goto L_selectspirit;
	}
L_buffselect:
	mes "[Guild Buffs]";
	mes "So, you want to buy " + buff$ + " for " + .@price + " Cash?";
	next;
	switch(select("Yes, please:No, thank you")){
	case 1:
		if (.@price) {
			set #CASHPOINTS, #CASHPOINTS;
			if (#CASHPOINTS < .@price) goto L_nobuffs;
			#CASHPOINTS -= .@price;
				if (buffon$=="assu"){
					set z, getarraysize($guildassumptio);
					set $guildassumptio[z+1], getcharid(2);
					goto L_buffbought;
				}
				if (buffon$=="magni"){
					set z, getarraysize($guildmagnificat);
					set $guildmagnificat[z+1], getcharid(2);
					goto L_buffbought;
				}
				if (buffon$=="angelus"){
					set z, getarraysize($guildangelus);
					set $guildangelus[z+1], getcharid(2);
					goto L_buffbought;
				}
				if (buffon$=="gloria"){
					set z, getarraysize($guildgloria);
					set $guildgloria[z+1], getcharid(2);
					goto L_buffbought;
				}
				if (buffon$=="impo"){
					set z, getarraysize($guildimpositio);
					set $guildimpositio[z+1], getcharid(2);
					goto L_buffbought;
				}
				if (buffon$=="spirit"){
					set z, getarraysize($guildspirit);
					set $guildspirit[z+1], getcharid(2);
					goto L_buffbought;
				}
		}
	case 2:
			mes "[Guild Buffs]";
			mes "As you wish.";
			close;
	}
L_buffbought:
		mes "[Guild Buffs]";
		mes "Transaction complete, the buff is now available for your guild.";
		close;

L_nobuffs:
		mes "[Guild Buffs]";
		mes "I'm sorry, you don't have enough cash.";
		close;

L_selectassumptio:
	if ($guildassumptio[y]==getcharid(2)) goto L_available;
	if (y>=getarraysize($guildassumptio)){
	set y, 0;
	goto L_buffselect;
	}
	if (y<=getarraysize($guildassumptio)) set y,y+1;
	goto L_selectassumptio;
	end;

L_selectimpositio:
	if ($guildimpositio[y]==getcharid(2)) goto L_available;
	if (y>=getarraysize($guildimpositio)){
	set y, 0;
	goto L_buffselect;
	}
	if (y<=getarraysize($guildimpositio)) set y,y+1;
	goto L_selectimpositio;
	end;

L_selectspirit:
	if ($guildspirit[y]==getcharid(2)) goto L_available;
	if (y>=getarraysize($guildspirit)){
	set y, 0;
	goto L_buffselect;
	}
	if (y<=getarraysize($guildspirit)) set y,y+1;
	goto L_selectspirit;
	end;

L_selectmagnificat:
	if ($guildmagnificat[y]==getcharid(2)) goto L_available;
	if (y>=getarraysize($guildmagnificat)){
	set y, 0;
	goto L_buffselect;
	}
	if (y<=getarraysize($guildmagnificat)) set y,y+1;
	goto L_selectmagnificat;
	end;

L_selectangelus:
	if ($guildangelus[y]==getcharid(2)) goto L_available;
	if (y>=getarraysize($guildangelus)){
	set y, 0;
	goto L_buffselect;
	}
	if (y<=getarraysize($guildangelus)) set y,y+1;
	goto L_selectangelus;
	end;

L_selectgloria:
	if ($guildgloria[y]==getcharid(2)) goto L_available;
	if (y>=getarraysize($guildgloria)){
	set y, 0;
	goto L_buffselect;
	}
	if (y<=getarraysize($guildgloria)) set y,y+1;
	goto L_selectgloria;
	end;

L_available:
	mes "[Guild Buffs]";
	mes "You already bought " + buff$ + ".";
	if(getguildmasterid(getcharid(2))==getcharid(0)) {
		mes "Do you want to remove it?";
		next;
		switch(select("No:Yes")){
		case 1:
			close;
			break;
		case 2:
			mes "^FF0000Keep in mind that you won't get any refund!^000000";
			mes "So, are you sure you want to take out that action?";
			next;
			switch(select("No:Yes")) {
			case 1:
				close;
			case 2:
				if (buffon$=="assu"){
					set $guildassumptio[y], 0;
					goto L_buffdeleted;
				}
				if (buffon$=="magni"){
					set $guildmagnificat[y], 0;
					goto L_buffdeleted;
				}
				if (buffon$=="angelus"){
					set $guildangelus[y], 0;
					goto L_buffdeleted;
				}
				if (buffon$=="gloria"){
					set $guildgloria[y], 0;
					goto L_buffdeleted;
				}
				if (buffon$=="impo"){
					set $guildimpositio[y], 0;
					goto L_buffdeleted;
				}
				if (buffon$=="spirit"){
					set $guildspirit[y], 0;
					goto L_buffdeleted;
				}
			}
		}
	close;
	}
L_buffdeleted:
	mes "[Guild Buffs]";
	mes "Transaction completed. " + buff$ + " has been deleted from your Guildbuffs.";
	close;
}

how to fix that error thx ?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

are you using hercules ?
1. hercules dropped specialeffect2 ... the way you use specialeffect is hercules format
2. hercules use SC_SOULLINK, rathena use SC_SPIRIT ... and your script follow hercules format again ...

rather than fix that script, I would rather re-write this whole thing ... using hercules

prontera,155,185,3	script	Guild Buffer	4_F_ARUNA_POP,{
	mes "[Guild Buffs]";
	if ( !getcharid(2) ) {
		mes "I'm sorry, I can only help you, if you're in a guild.";
		close;
	}
	mes "Hello, I offer buffs for guilds.";
	mes "Please select the buff you want to buy for your guild.";
	mes "The buffs you bought will be permanently available for your guild.";
	next;
	mes "[Guild Buffs]";
	mes "Guild Leaders can remove buffs by selecting to buy them and then confirming.";
	.@gid = getcharid(2);
	next;
	.@s = select( ( (getguildmasterid( getcharid(2) ) == getcharid(0))? "^FF0000Guild Master setting^000000:" : ":" )+ .buff_menu$ ) -2;
	if ( .@s == -1 ) {
		.@s = select( .buff_menu$ ) -1;
		mes "[Guild Buffs]";
		if ( $guild_buff[.@gid] & (1 << .@s) ) {
			mes "You already bought "+ .buff_desc$[.@s] +".";
			mes "Do you want to remove it?";
			next;
			if ( select( "No", "Yes" ) == 1 ) close;
			$guild_buff[.@gid] &= ~(1 << .@s);
			mes "[Guild Buffs]";
			mes "Transaction completed. "+ .buff_desc$[.@s] +" has been deleted from your Guildbuffs.";
			close;
		}
		if ( .buff_price[.@s] > Zeny ) { // can change into #CASHPOINTS
			mes "I'm sorry, you don't have enough cash.";
			close;
		}
		Zeny -= .buff_price[.@s]; // can change into #CASHPOINTS
		mes "Transaction complete, the buff is now available for your guild.";
		$guild_buff[.@gid] |= (1 << .@s);
		close;
	}
//	if ( $guild_buff[.@gid] & (1 << .@s) )
		callsub L_Buff, .@s;
	// no dialog for buff that is not yet bought ...
	close;
	
L_Buff:
	.@gid = getcharid(2);
	switch ( getarg(0) ) {
	case 0:
		if ( $guild_buff[.@gid] & (1<<0) ) {
			sc_start SC_ASSUMPTIO, -1, 5;
//			specialeffect EF_ASSUMPTIO, AREA, getcharid(3);
			skilleffect HP_ASSUMPTIO, 5;
		}
		break;
	case 1:
		if ( $guild_buff[.@gid] & (1<<1) ) {
			sc_start SC_MAGNIFICAT, -1, 5;
//			specialeffect EF_MAGNIFICAT, AREA, getcharid(3);
			skilleffect PR_MAGNIFICAT, 5;
		}
		break;
	case 2:
		if ( $guild_buff[.@gid] & (1<<2) ) {
			sc_start SC_ANGELUS, -1, 10;
//			specialeffect EF_ANGELUS, AREA, getcharid(3);
			skilleffect AL_ANGELUS, 10;
		}
	break;
	case 3:
		if ( $guild_buff[.@gid] & (1<<3) ) {
			sc_start SC_GLORIA, -1, 5;
//			specialeffect EF_GLORIA, AREA, getcharid(3);
			skilleffect PR_GLORIA, 5;
		}
	break;
	case 4:
		if ( $guild_buff[.@gid] & (1<<4) ) {
			sc_start SC_IMPOSITIO, -1, 5;
//			specialeffect EF_IMPOSITIO, AREA, getcharid(3);
			skilleffect PR_IMPOSITIO, 5;
		}
		break;
	case 5:
		if ( $guild_buff[.@gid] & (1<<5) ) {
			switch( BaseJob ) {
				case Job_Alchemist: .@spirit = SL_ALCHEMIST; break;
				case Job_Monk: .@spirit = SL_MONK; break;
				case Job_Star_Gladiator: .@spirit = SL_STAR; break;
				case Job_Sage: .@spirit = SL_SAGE; break;
				case Job_Crusader: .@spirit = SL_CRUSADER; break;
				case Job_SuperNovice: .@spirit = SL_SUPERNOVICE; break;
				case Job_Knight: .@spirit = SL_KNIGHT; break;
				case Job_Wizard: .@spirit = SL_WIZARD; break;
				case Job_Priest: .@spirit = SL_PRIEST; break;
				case Job_Bard: case Job_Dancer: .@spirit = SL_BARDDANCER; break;
				case Job_Rogue: .@spirit = SL_ROGUE; break;
				case Job_Assassin: .@spirit = SL_ASSASIN; break;
				case Job_Blacksmith: .@spirit = SL_BLACKSMITH; break;
				case Job_Hunter: .@spirit = SL_HUNTER; break;
//				case Job_Soul_Linker: .@spirit = SL_SOULLINKER; break; // excluding soul linker spirite
				default:
//					if ( ( Upper & 1 ) && BaseLevel < 70 && !( eaclass() & EAJL_2 ) ) // excluding rebirth spirit
//							.@spirit = SL_HIGH;
			}
			if ( .@spirit ) {
				sc_start4 SC_SOULLINK, -1, 4, .@spirit, 0, 0;
//				specialeffect EF_SOULLINK, AREA, getcharid(3);
				skilleffect .@spirit, 5;
			}
		}
	}
	return;
OnInit:
	.buff_name$[0] = "Assumptio";
	.buff_desc$[0] = "Assumptio Level 5";
	.buff_price[0] = 1000;
	.buff_effect[0] = EF_ASSUMPTIO;

	.buff_name$[1] = "Magnificat";
	.buff_desc$[1] = "Magnificat Level 5";
	.buff_price[1] = 5000;
	
	.buff_name$[2] = "Angelus";
	.buff_desc$[2] = "Angelus Level 10";
	.buff_price[2] = 5000;
	
	.buff_name$[3] = "Gloria";
	.buff_desc$[3] = "Gloria Level 5";
	.buff_price[3] = 5000;
	
	.buff_name$[4] = "Impositio Manus";
	.buff_desc$[4] = "Impositio Manus Level 5";
	.buff_price[4] = 5000;
	
	.buff_name$[5] = "Spirits";;
	.buff_desc$[5] = "Spirits Level 4 (excluding Rebirth Spirit and Soul Linker Spirit)";
	.buff_price[5] = 10000;

	.buff_menu$ = implode(.buff_name$, ":");
	end;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...