Jump to content
  • 0

Help with OnTimer


Vector

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  10/13/13
  • Last Seen:  

Hello guys, i'm a little novice in rAthena scripting and i have one trouble with the timers logic and flow.
 
can you check the code and tell me why the #$%&/ timer don't run?
 
regards
 
 
job3_gen01,44,46,5	script	Hetfield	940,{
	disablenpc "mvptimer";
	mes "^FF8000[Hetfield]^000000";
	mes "Hola, mis ancestros han heredado por generaciones";
	mes "un misterioso poder con el cual";
	mes "invocamos a los MvP's mas poderosos";
	mes "de todo Rune of nifelheim.";
	next;
	mes "^FF8000[Hetfield]^000000";
	mes "Puedo invocar a una gran bestia";
	mes "sin embargo necesitan darme algo...";
	next;
	mes "^FF8000[Hetfield]^000000";
	mes "^0101DFQuiero 100,000,000 de zeny.^000000";
	mes "Todos en este mundo pueden darme la cantidad que quieran";
	mes "y cuando llegue al monto que dije";
	mes "anunciare la llegada del ya mencionado poderoso MvP.";
	next;
	mes "^FF8000[Hetfield]^000000";
	mes "No se que MvP saldra, pero de lo que podeis";
	mes "estar seguros, es que es tremendamente fuerte.";
	next;
	mes "^FF8000[Hetfield]^000000";
	mes "Actualmente han donado: ^0101DF"+$MVPZENY+"^000000";
	mes "Quieres donarme Zeny?";
	if (select("Si","No")==1){
	mes "Acepto como minimo 1 millon y maximo 5 millones.";
	mes "Dime cuanto quieres darme:";
	input @zeny;
		if(@zeny <= 5000000 && @zeny >= 1000000){
			if(Zeny < @zeny){
			mes "Ridiculo No cuentas con esa cantidad de Zeny!";
			end;
			}else{
			mes "^0101DFGracias por los: "+@zeny+" z^000000";
			set Zeny, Zeny - @zeny;
			set $MVPZENY, $MVPZENY + @zeny;
			announce strcharinfo(0)+" ha donado "+@zeny+"z al NPC Hetfield para invocar una bestia poderosa...",bc_map,0x9ACD32;
			enablenpc "mvptimer";
			next;
			
			if($MVPZENY >= 100000000){
			mes "^FF8000[Hetfield]^000000";
			mes "OHH!!! He conseguido el Zeny que necesitaba, preparaos para la invocacion del poderoso MvP en la ciudad de Morroc!";
			set $MVPZENY,0;
			


			end;
			}
			next;
			mes "^FF8000[Hetfield]^000000";
			mes "Oh si, cuando tenga toda la plata";
			mes "Voy a llamar a la gran bestia que prometi...";
			end;
			}

		}else{
		next;
		mes "^FF8000[Hetfield]^000000";
		mes "Ya te dije cuanto Zeny acepto. adios!";
		end;
				
		}
		
	

	}else{
	end;
	}


}

-	script	mvptimer	-1,{
			
			OnEnable:
				initnpctimer;
				end;
			OnTimer3000:
				announce "Ok 3 segundos mas [Testing NPC... ignore it].",bc_all,0x9ACD32;
				end;
			OnTimer5000:
				announce "Ok 2 segundos mas [Testing NPC... ignore it].",bc_all,0x9ACD32;
				end;
			OnTimer6000:
				stopnpctimer;
				end;
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

Use donpcevent "<NPC object name>::<event label>"; to invoke an event label. Disabled/enabled npc only disable/enable the npc (read the docs in script_commands) so the timer never start.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  10/13/13
  • Last Seen:  

Use donpcevent "<NPC object name>::<event label>"; to invoke an event label. Disabled/enabled npc only disable/enable the npc (read the docs in script_commands) so the timer never start.

 

awesome, really thanks! 

 

it worked!

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