Jump to content
  • 0

When Player logs out...


Mr BrycE

Question


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

Hi, how to check when, player suddenly logs out? 

its "set+1" is back to 0? 

also, how to add when the player also suddenly disconnects the dungeon will reset?

 

here:

prontera,131,171,5	script	Ryze	823,{
set map7,getmapusers("2@pump");
if(gettimetick(2) - noctdead < (60 * 60 * 12)) {
mes "^0000FF[ Ryze ]^000000";
mes "I'm sorry but you have to wait";
mes "12 Hours until you can do the this Quest again!";
soundeffect "Ryzezap.wav",0;
close;

}
if(map7 >= 1) goto L_cant;
if(countitem(6024) >= 20 && countitem(7300) >= 5 && countitem(7723) >= 5) goto L_OkayUsap;
	mes "^0000FF[ Ryze ]^000000";
	mes "***Can you handle this?***";
	soundeffect "Ryzehandle.wav",0;
	showevent 1,0;
	emotion e_gg;
	next;
	mes "^0000FF[ Ryze ]^000000";
	mes "I need ^FF0000 20pcs of 17Carat of Diamonds^000000!";
	mes "^FF0000 5 Gemstones^000000!";
	mes "and ^FF0000 5 Diamonds of Ruin^000000";
	mes "Bring that back to me so that we can kill Nocturne .";
	close;

L_cant:
mes "^0000FF[ Ryze ]^000000";
mes "The Quest for Nocturne has already occupied";
mes "Please wait for your turn";
soundeffect "Ryzezap.wav",0;
close;


L_OkayUsap:
	mes "^0000FF[ Ryze ]^000000";
	mes "Zap!";
	showevent 1,0;
	soundeffect "Ryzezap.wav",0;
	next;
	mes "^0000FF[ Ryze ]^000000";
	mes "Go with me and let's slay Nocturne";
if (select("Follow Ryze:Ignore him") == 2) {
	mes "^0000FF[ Ryze ]^000000";
	mes "Do whatever you want";
	close;
}
	mes "^0000FF[ Ryze ]^000000";
	mes "Can you handle this?.";
	mes "i'll use my teleport to warp us both in his dungeon";
	soundeffect "Ryzeletsgo.wav",0;
	sleep2 2000;
	awake "Ryze";
	warp "2@pump",81,80;
	close;

}

2@pump,82,86,5	script	Ryze#1	823,{
	mes "^0000FF[ Ryze ]^000000";
	mes "What's that unpleasnt smell!?";
	mes "ewww...";
	soundeffect "Ryzeunpleasant.wav",0;
	next;
	mes "^0000FF[ Ryze ]^000000";
	mes "That filthy Nocturne";
	mes "i'll chant my spell to wake that bastard";
	dispbottom "Ryze is chanting some magic words";
	sleep2 5000;
	awake "Ryze#1";
	mapannounce "2@pump","Nocturne: Embrace the darkness....",0;
	soundeffect "Nocturne.wav",0;
	sc_start SC_BLIND,1800000,0;
	sleep2 2000;
	awake "Ryze#1";
	next;
	mes "^0000FF[ Ryze ]^000000";
	mes "Come on Already!.";
	soundeffect "Ryzecome.wav",0;
	next;
	mes "^0000FF[ Ryze ]^000000";
	mes "Let's force him to get out on his chamber";
	next;
	menu "Ok.",L_Yes,"No,Dont!",-;
	mes "^0000FF[ Ryze ]^000000";
	mes "EHHH??";
	close;

OnPCDieEvent:
getmapxy(.@map$,.@x,.@y,0);
if(.@map$=="2@pump") {
dispbottom "You will revive back in Nocturne's Chamber in 3 Second(s)";
recovery 3,"2@pump";
sleep2 3000;
warp "2@pump",83,98;
sc_start SC_BLIND,1800000,0;
end;


L_Yes:
	monster "2@pump",124,41,"Chamber's Tower",3504,1,"Ryze#1::OnThisMobDeath2";
	monster "2@pump",36,40,"Chamber's Tower",3504,1,"Ryze#1::OnThisMobDeath2";
	monster "2@pump",40,126,"Chamber's Tower",3504,1,"Ryze#1::OnThisMobDeath2";
	monster "2@pump",120,127,"Chamber's Tower",3504,1,"Ryze#1::OnThisMobDeath2";
	mapannounce "2@pump","The Chamber's Four Tower has risen from the ground!",0;
	mes "^0000FF[ Ryze ]^000000";
	mes "Don't hold me up";
	hideonnpc "Ryze#1";
	soundeffect "Ryzedonthold.wav",0;
	close;

OnThisMobDeath2:
	set $ToweKilled,$ToweKilled+1;
	if ($ToweKilled==4) goto OnThisMobDeath03;
	end;

OnThisMobDeath03:
	mapannounce "2@pump","A Wave of Monsters are Coming!",0;
	sleep2 3000;
	awake "Ryze#1";
	mapannounce "2@pump","Nocturne: Cut them from this world!",0;
	soundeffect "Nocturne2.wav",0;
	sleep2 5000;
	awake "Ryze#1";
	monster "2@pump",0,0,"Nocturne's Soldier",1302,20,"Ryze#1::OnThisMobDeath04";
	monster "2@pump",0,0,"Nocturne's Soldier",1260,20,"Ryze#1::OnThisMobDeath04";
	monster "2@pump",0,0,"Nocturne's Soldier",1202,30,"Ryze#1::OnThisMobDeath04";
	monster "2@pump",0,0,"Nocturne's Soldier",2015,20,"Ryze#1::OnThisMobDeath04";
	end;

OnThisMobDeath04:
	set $Mobs2Killed,$Mobs2Killed+1;
	if ($Mobs2Killed==90) goto OnThisMobDeath3;
	end;

OnThisMobDeath3:
	mapannounce "2@pump","Second Wave of Monsters are Coming!",0;
	sleep2 3000;
	awake "Ryze#1";
	mapannounce "2@pump","Nocturne: Are you getting tired? yet?!",0;
	soundeffect "Nocturne3.wav",0;
	sleep2 5000;
	awake "Ryze#1";	
	monster "2@pump",0,0,"Nocturne High Soldier",1272,3,"Ryze#1::OnThisMobDeath05";
	monster "2@pump",0,0,"Nocturne's Soldier",1870,20,"Ryze#1::OnThisMobDeath05";
	monster "2@pump",0,0,"Nocturne's Soldier",1869,30,"Ryze#1::OnThisMobDeath05";
	monster "2@pump",0,0,"Nocturne's Soldier",1867,10,"Ryze#1::OnThisMobDeath05";
	end;

OnThisMobDeath05:
        set $Mobs3Killed,$Mobs3Killed+1;
        if ($Mobs3Killed==63) goto OnThisMobDeath5;
        end;

OnThisMobDeath5:
	mapannounce "2@pump","The Chamber's Four Tower has risen again from the ground!",0;
	sleep2 3000;
	awake "Ryze#1";
	soundeffect "Nocturne4.wav",0;
	sleep2 5000;
	awake "Ryze#1";
	monster "2@pump",124,41,"Chamber's Tower",3504,1,"Ryze#1::OnThisMobDeath06";
	monster "2@pump",36,40,"Chamber's Tower",3504,1,"Ryze#1::OnThisMobDeath06";
	monster "2@pump",40,126,"Chamber's Tower",3504,1,"Ryze#1::OnThisMobDeath06";
	monster "2@pump",120,127,"Chamber's Tower",3504,1,"Ryze#1::OnThisMobDeath06";
	dispbottom "Destroy the risen towers again";
	end;

OnThisMobDeath06:
	set $Towe2Killed,$Towe2Killed+1;
	if ($Towe2Killed==4) goto OnThisMobDeath6;
	end;

OnThisMobDeath6:
	mapannounce "2@pump","Nocturne: DARKNESS ....",0;
	soundeffect "Nocturne5.wav",0;
	sleep2 5000;
	awake "Ryze#1";
	monster "2@pump",0,0,"Nocturne",2255,1,"Ryze#1::OnThisMobDeath7";
	end;

OnThisMobDeath7:
	set $NoctKilled,$NoctKilled+1;
	if ($NoctKilled==1) goto L_AllDead;
	end;


L_AllDead:
	while (1) {
		set .@rand, rand(.totalchance);
		set .@i, 0;
		while (1) {
			set .@rand, .@rand - .itemchance[.@i];
			if ( .@rand < 0 ) break;
			set .@i, .@i +1 ;
		}
		getitem .itemid[.@i], 1;
		sc_end SC_BLIND;
		mapannounce "2@pump","Ryze: Good work champ!",0;
		sleep2 2000;
		awake "Ryze#1";
set $ToweKilled,0;
set $Towe2Killed,0;
set $Mobs2Killed,0;
set $Mobs3Killed,0;
set $NoctKilled,0;
set noctdead,gettimetick(2);
		delitem 6024,20;
		delitem 7723,5;
		delitem 7300,5;
		specialeffect2 EF_ANGEL;
		specialeffect2 EF_TRUESIGHT;
		dispbottom "In 10 seconds you will warp back in Prontera";
sleep 10000;
		mapwarp "2@pump","prontera",153,166,0;
		hideoffnpc "Ryze#1";
		end;
	sleep2 1;
}

OnInit:
	setarray .itemid, 2480,2891,2475,2574,607,607,607,607,607,607,607,607,15008;
	setarray .itemchance, 5,5,5,5,20,20,20,20,20,20,20,20,5;
	set .itemsize, getarraysize(.itemid);
	while ( .@i < .itemsize ) {
		set .totalchance, .totalchance + .itemchance[.@i];
		set .@i, .@i +1 ;
	
		}
	}
}



//Mapflags

2@pump	mapflag	nowarp
2@pump	mapflag	nowarpto
2@pump	mapflag	nomemo
2@pump	mapflag	noreturn
2@pump	mapflag	noteleport
2@pump	mapflag	nobranch
2@pump	mapflag	nosave

Edited by Mr BrycE
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  90
  • Reputation:   5
  • Joined:  06/17/12
  • Last Seen:  

try

OnPCLogoutevent:

 

same idea from here http://rathena.org/board/topic/74607-dedicated-npc/

Edited by KoolKat29
Link to comment
Share on other sites


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

I suggest

set .@mmap7, getmapusers("2@pump");
if ( .@map7 == 0 ) {
	hideonnpc "Ryze#1";
	set getvariableofnpc( .ToweKilled, "Ryze#1" ), 0;
	... = 0;
}
if(gettimetick(2) - noctdead < (60 * 60 * 12)) {

 

 

Miscs :

set map7,getmapusers("2@pump");

no need to use permanent variable for this, use .@map variable

 

 

	sleep2 5000;
	awake "Ryze#1";

no need awake after a sleep, the script continue after the count

 

 

 

You can use .ToweKilled variable instead of $ToweKilled

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  125
  • Topics Per Day:  0.03
  • Content Count:  595
  • Reputation:   23
  • Joined:  02/23/12
  • Last Seen:  

try

OnPCLogoutevent:

 

same idea from here http://rathena.org/board/topic/74607-dedicated-npc/

ill try it..

 

 

I suggest

set .@mmap7, getmapusers("2@pump");
if ( .@map7 == 0 ) {
	hideonnpc "Ryze#1";
	set getvariableofnpc( .ToweKilled, "Ryze#1" ), 0;
	... = 0;
}
if(gettimetick(2) - noctdead < (60 * 60 * 12)) {

 

 

Miscs :

set map7,getmapusers("2@pump");

no need to use permanent variable for this, use .@map variable

 

 

	sleep2 5000;
	awake "Ryze#1";

no need awake after a sleep, the script continue after the count

 

 

 

You can use .ToweKilled variable instead of $ToweKilled

thank you /thx

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