Jump to content
  • 0

Can anyone help me lucky npc error


gustabrayan225

Question


  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.35
  • Content Count:  30
  • Reputation:   0
  • Joined:  05/01/24
  • Last Seen:  

prontera,164,156,4	script	Sortudo::sorte	4_M_LGTMAN,{
Init:
mes "[Sortudo]";
if(getgmlevel()>10 && getgmlevel()<99){
	mes "GM's não podem participar dos eventos!";
	close;
}
if($SorteFechou==1){ mes "Desculpe estamos fechados";
}else { mes "O que deseja fazer hoje?"; }
if(getgmlevel()>98) menu "Ir até o evento",Evento,"Tutorial do NPC",Tutorial,"Ver Drops",Alterar,"Cancelar",bye;
	menu "Ir até o evento",Evento,"Tutorial do NPC",Tutorial,"Ver Items possíveis de se ganhar",SeeItens,"Sair",bye;

Alterar:
	next;
	mes "[Painel do GM]";
	for(set @i,0; @i<=GetArraySize $DropsSorte-1; set @i,@i+2) mes @i/2+": "+$DropsSorte[@i+1]+"  "+GetItemName($DropsSorte[@i]);
	mes "Prêmio em Zenys: "+$PremioZeny;
	mes "Deseja mudar algo?";
	menu "Mudar um Item",muditem,"Adicionar um Item",aditem,"Mudar Prêmio em Zenys",pzeny,"Cancelar",bye;
muditem:
	next;
	mes "[Painel do GM]";
	for(set @i,0; @i<=GetArraySize($DropsSorte)-1; set @i,@i+2) mes @i/2+": "+$DropsSorte[@i+1]+"  "+GetItemName($DropsSorte[@i]);
	mes "Digite o número do item a ser mudado:";
	digit @ID;
	next;
	mes "[Painel do GM]";
	mes "Deseja mesmo mudar o item "+$DropsSorte[@ID+1]+"  "+GetItemName($DropsSorte[@ID])+" ?";
	menu "Sim, Mudar o Item",mi,"Sim, Mudar a Quantidade Dropada",md,"Não, quero mudar outro item",muditem,"Não, não quero mudar nenhum item",bye;
mi:
	next;
	mes "[Painel do GM]";
	mes "Digite a ID do novo item:";
	digit @newid;
	next;
	mes "[Painel do GM]";
	mes "Você digitou: "+GetItemName(@newid);
	mes "Correto?";
	menu "Sim",-,"Não!",mi,"Cancelar",bye;
	SetArray $DropsSorte[@ID],@newid;
md:
	next;
	mes "[Painel do GM]";
	mes "Digite a Quantidade a ser dropada do "+GetItemName($DropsSorte[@ID]);
	digit @newqnt;
	next;
	mes "[Painel do GM]";
	mes "Você digitou: "+@newqnt;
	mes "Correto?";
	menu "Sim",-,"Não!",md,"Cancelar",bye;
	SetArray $DropsSorte[@ID+1],@newqnt;
	next;
	goto Init;
aditem:
	next;
	mes "[Painel do GM]";
	mes "Digite a ID do novo item:";
	digit @newid;
	next;
	mes "[Painel do GM]";
	mes "Você digitou: "+GetItemName(@newid);
	mes "Correto?";
	menu "Sim",-,"Não!",aditem,"Cancelar",bye;
admd:
	next;
	mes "[Painel do GM]";
	mes "Digite a Quantidade a ser dropada do "+@newid;
	digit @newqnt;
	next;
	mes "[Painel do GM]";
	mes "Você digitou: "+@newqnt;
	mes "Correto?";
	menu "Sim",-,"Não!",admd,"Cancelar",bye;
	next;
	mes "[Painel do GM]";
	mes "O Item ficou assim: "+@newqnt+" "+GetItemName(@newid);
	mes "Correto?";
	menu "Sim!",-,"Não, Mudar Item",aditem,"Não, Mudar Quantidade a se Dropada",admd,"Cancelar",Init;
	next;
	mes "[Painel do GM]";
	mes "Item Adicionado com Sucesso!";
	SetArray $DropsSorte[GetArraySize($DropsSorte)],@newid,@newqnt;
	next;
	goto Init;
pzeny:
	next;
	mes "[Painel do GM]";
	mes "Caso o jogador não drope o item, ele morrerá ou ganhará uma quantia em zeny";
	mes "Digite qual será esta quantia";
	digit @Zeny;
	next;
	mes "[Painel do GM]";
	mes "Você digitou "+@Zeny+" está correto?";
	menu "Sim, está",-,"Não, quero mudar a quantia",pzeny;
	next;
	smes "[Painel do GM]";
	mes "Zenys Configurados com Sucesso!";
	set $PremioZeny,@Zeny;
	next;
	goto Init;

bye:
mes "[Sortudo]";
mes "Até Mais!";
close;

SeeItens:
	next;
	mes "[Sortudo]";
	mes "Estes são os itens que podem cair dos baús:";
	for(set @i,0; @i<=GetArraySize($DropsSorte)-1; set @i,@i+2) mes @i/2+": "+$DropsSorte[@i+1]+"  "+GetItemName($DropsSorte[@i]);
	mes "Prêmio em Zenys: "+$PremioZeny;
	next;
	goto Init;

Evento:
next;
if($SorteFechou==1){
	mes "[Sortudo]";
	mes "Desculpe-me, mas os Warps estão fechados...";
	close;
}
mes "[Sortudo]";
mes "Vamos lá!";
Set @place,Rand(3);
if($EventoSorte==2){
	if(@place==0) warp "quiz_02",37,52;
	if(@place==1) warp "quiz_02",49,52;
	if(@place==2) warp "quiz_02",61,52;
	if(@place==3) warp "quiz_02",73,52;
	close;
}else if($EventoSorte==3){
	if(@place==0) warp "quiz_02",318,34;
	if(@place==1) warp "quiz_02",330,34;
	if(@place==2) warp "quiz_02",342,34;
	if(@place==3) warp "quiz_02",354,34;
	close;
}else if($EventoSorte==4){
	warp "quiz_02",304,234;
	close;
}

Tutorial:
next;
mes "[Sortudo]";
mes "O evento se chama ^FF0000Evento da Sorte^000000 pois";
mes "você precisa de muita sorte nele";
next;
mes "[Sortudo]";
mes "Você entra em uma sala, onde será pvp!";
mes "Após 2 Minutos, aparecerá um baú que permitirá que você passe para o nível 2, para lutar pelo Prêmio Final";
next;
mes "[Sortudo]";
mes "Mas há um modo onde não há nível 2, mas há 2 Baús de Prêmio!!";
next;
mes "[Sortudo]";
mes"Os items que serão dropados do baú serão configurados pelos GMs do BeatRO!";
close;

OnHour01:
OnHour05:
OnHour09:
OnHour13:
OnHour17:
OnHour21:
	set $EventoSorte,Rand(2,4);
	Set $SorteFechou,0;
	Announce "[NPC]Sortudo: O Evento da sorte está prestes a começar! Seja rápido e corra! Você tem 5 minutos!",0;
	initnpctimer;
end;

OnTimer300000:
	//set $EventoSorte,1;
	Set $SorteFechou,1;
	Announce "[NPC]Sortudo: Os warps fecharam, sinto muito tente da próxima vez!",0;
	SetMapFlag "quiz_02",mf_pvp;
	SetMapFlag "quiz_02",mf_pvp_noparty;
	SetMapFlag "quiz_02",mf_pvp_noguild;
	MapAnnounce "quiz_02","O Evento da Sorte Começou!",8;
end;

OnTimer420000:
if($EventoSorte==2){
	monster	"quiz_02",37,73,	"Tesouro Passaporte",1732,1,"sorte::OnPassouNivel21";
	monster	"quiz_02",49,73,	"Tesouro Passaporte",1732,1,"sorte::OnPassouNivel22";
	monster	"quiz_02",61,73,	"Tesouro Passaporte",1732,1,"sorte::OnPassouNivel23";
	monster	"quiz_02",73,73,	"Tesouro Passaporte",1732,1,"sorte::OnPassouNivel24";
}else if($EventoSorte==3){
	monster	"quiz_02",319,57,	"Tesouro Passaporte",1732,1,"sorte::OnPassouNivel31";
	monster	"quiz_02",331,57,	"Tesouro Passaporte",1732,1,"sorte::OnPassouNivel32";
	monster	"quiz_02",343,57,	"Tesouro Passaporte",1732,1,"sorte::OnPassouNivel33";
	monster	"quiz_02",355,57,	"Tesouro Passaporte",1732,1,"sorte::OnPassouNivel34";
}else if($EventoSorte==4){
	monster	"quiz_02",297,267,	"Tesouro Final",1732,1,"sorte::OnGanhou";
	monster	"quiz_02",311,267,	"Tesouro Final",1732,1,"sorte::OnGanhou";
}
end;
//Evento 2
OnPassouNivel21:
	warp "quiz_02",37,80;
	MapAnnounce "quiz_02",strcharinfo(0)+" Passou para o Nível 2!!!",8;
	areawarp "quiz_02",33,52,41,73,"prontera",155,185;
end;
OnPassouNivel22:
	warp "quiz_02",49,80;
	MapAnnounce "quiz_02",strcharinfo(0)+" Passou para o Nível 2!!!",8;
	areawarp "quiz_02",45,52,53,73,"prontera",155,185;
end;
OnPassouNivel23:
	warp "quiz_02",61,80;
	MapAnnounce "quiz_02",strcharinfo(0)+" Passou para o Nível 2!!!",8;
	areawarp "quiz_02",57,52,65,73,"prontera",155,185;
end;
OnPassouNivel24:
	warp "quiz_02",73,80;
	MapAnnounce "quiz_02",strcharinfo(0)+" Passou para o Nível 2!!!",8;
	areawarp "quiz_02",69,52,73,73,"prontera",155,185;
end;
//Evento 3
OnPassouNivel31:
	warp "quiz_02",319,60;
	MapAnnounce "quiz_02",strcharinfo(0)+" Passou para o Nível 2!!!",8;
	areawarp "quiz_02",314,34,323,57,"prontera",155,185;
end;
OnPassouNivel32:
	warp "quiz_02",331,60;
	MapAnnounce "quiz_02",strcharinfo(0)+" Passou para o Nível 2!!!",8;
	areawarp "quiz_02",326,34,335,57,"prontera",155,185;
end;
OnPassouNivel33:
	warp "quiz_02",343,60;
	MapAnnounce "quiz_02",strcharinfo(0)+" Passou para o Nível 2!!!",8;
	areawarp "quiz_02",338,34,347,57,"prontera",155,185;
end;
OnPassouNivel34:
	warp "quiz_02",355,60;
	MapAnnounce "quiz_02",strcharinfo(0)+" Passou para o Nível 2!!!",8;
	areawarp "quiz_02",350,34,359,57,"prontera",155,185;
end;
//Continua Evento (Nivel 2 agora!)
OnTimer430000:
	MapAnnounce "quiz_02","Parabéns a Vocês que passaram ao Nível 2, mas o Evento ainda não Acabou!",8;
end;
OnTimer435000:
	MapAnnounce "quiz_02","O Tesouro Final aparecerá em 1 minuto e meio!!!",8;
end;
//O Tesouro Final!
OnTimer540000:
	MapAnnounce "quiz_02","O Tesouro Final apareceu!!!",8;
	if($EventoSorte==2){
		monster	"quiz_02",54,95,	"Tesouro Final",1732,1,"sorte::OnGanhou";
	}else if($EventoSorte==3){
		monster	"quiz_02",338,83,	"Tesouro Final",1732,1,"sorte::OnGanhou";
	}
end;

OnTimer600000:
	killmonsterall "quiz_02";
	RemoveMapFlag "quiz_02",mf_pvp;
	RemoveMapFlag "quiz_02",mf_pvp_noparty;
	RemoveMapFlag "quiz_02",mf_pvp_noguild;
	StopNpcTimer;
end;

OnGanhou:
set .@Prize, rand(2);
if(.@Prize == 0){
set @premio,Rand(GetArraySize($DropsSorte)/2);
additem $DropsSorte[@premio*2],$DropsSorte[@premio*2+1];
warp "prontera.gat",155,185;
Announce "[NPC]Sortudo: O jogador "+strcharinfo(0)+" quebrou um dos baús, seu prêmio foi: "+getitemname($DropsSorte[@premio*2])+"",4;
end;
}
if(.@Prize == 1){
set Zeny,Zeny+$Premiozeny;
warp "prontera.gat",155,185;
Announce "[NPC]Sortudo: O jogador "+strcharinfo(0)+" quebrou um dos baús, seu prêmio foi "+$Premiozeny+" zenys",4;
end;
}
if(.@Prize == 3){
atcommand "@kill "+strcharinfo(0)+"";
Announce "[NPC]Sortudo: Mas que pena, o jogador "+strcharinfo(0)+" quebrou um dos baús e, além de não ganhar nada, morreu!",4;
end;
}

OnInit:
       waitingroom "  Sortudo "+.server$+" ",0,"",0;
	if(!GetArraySize($DropsSorte)) SetArray $DropsSorte[0],20000,5;
end;
}

//MapFlag
quiz_02.gat	mapflag	nomemo
quiz_02.gat	mapflag	nowarp
quiz_02.gat	mapflag	nowarpto
quiz_02.gat	mapflag	noicewall
quiz_02.gat	mapflag	nosave
quiz_02.gat	mapflag	noteleport
quiz_02.gat	mapflag	nopenalty
quiz_02.gat	mapflag	nobranch

 

imagem_2024-05-06_225227434.png

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  240
  • Reputation:   90
  • Joined:  06/30/18
  • Last Seen:  

You forgot the brackets of the GetArraySize call on line 16.

for(set @i,0; @i<=GetArraySize($DropsSorte)-1; set @i,@i+2) mes @i/2+": "+$DropsSorte[@i+1]+"  "+GetItemName($DropsSorte[@i]);

 

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...