Jump to content

Question

Posted
// By http://Game-Mun.Com Poring Game-Mun.Com CMD
// ปรับแต่งของรางวัลได้ตามใจชอบ
// มีปัญหา โพสถามได้ที่ บอร์ด Game-Mun.Com

morocc,201,106,4	script	Poring Commando::poringCommando	723,{
	mes .name$;
	mes "ท่านสนใจเข้าร่วมกิจกรรม";
	mes "Poring Commando ไหมล่ะ";
	mes "ค่าเข้า " + .zenyReq + " เงิน";
	next;
	menu "เข้าร่วมกิจกรรม " + .zenyReq + " เงิน",-,"ไม่ดีกว่า",Cancel;
	if($@isPoringCmdStart == 1){
		mes .name$;
		mes "ขณะนี้ได้เริ่มการกิจกรรมไปแล้ว";
		mes "โปรดรอรอบต่อไป";
		close;
	}
	if(Zeny < .zenyReq){
		mes .name$;
		mes "คุณมี เงิน ไม่พอไม่สามารถลงเล่นได้";
		close;
	}
	if ( countitem(7621) > 0) goto Lcancel;
	announce "ท่าน [ "+strcharinfo(0)+" ] ได้เข้าร่วม Poring Commando แล้ว",bc_all,0x00FF00;
	set Zeny, Zeny-.zenyReq;
	set poringCmdFlag, $poringCmdFlag;
	warp $@poringCmdMap$,43,52;
	close;

	Cancel:
	mes .name$;
	mes "ไว้เจอกันใหม่นะ";
	close;

	Lcancel:
	mes .name$;
	mes "คุณพก ^FF0000Token of Ziegfried^000000";
	mes "ไม่สามารถร่วมกิจกรรมได้ค่ะ ลาก่อน";
	close;

	OnSpawn:
	//Spawn at max rate first
	mapannounce $@poringCmdMap$,"Poring Commando เริ่มขึ้นแล้ว!! คุณมีหน้าที่เพียงแค่อยู่รอดเท่านั้น ยิ่งอยู่รอดได้นาน ยิ่งได้ เงิน มากขึ้น",bc_map,0xBFEFFF;
	monster $@poringCmdMap$,43,64,"Poring",.poringMobID[0],.spawnMax[0],"poringCommando::OnPoringDie";
	//areamonster $@poringCmdMap$,33,33,58,58,"Poring",.poringMobID[0],.spawnMax[0],"poringCommando::OnPoringDie";
	end;

	OnPoringDie:
	end;	//Nothing just use for mobcount

	OnPCLogoutEvent:	//ถ้าต้องการให้เมื่อผู้เล่นออกจากเกม (กรณีหลุด หรือเซอเวอร์ดับ) แล้วได้เงิน ให้เอา // ข้างหน้าออก
	OnPCDieEvent:
	getmapxy .@map$, .@x, .@y, 0;
	announce .@map$ + "," + $@poringCmdMap$ + "," + poringCmdFlag + "," + $poringCmdFlag, 16;
	if(.@map$ == $@poringCmdMap$ && poringCmdFlag == $poringCmdFlag){
		mapannounce $@poringCmdMap$, "ผู้เล่น " + strcharinfo(0) + " ได้พ่ายแพ้ต่อฝูง Poring แล้ว ได้รับ เงิน รางวัล " + (.zenyPrz[(gettimetick(2)-.startTime)/60]) +  " เงิน", bc_map,0xFF0000;
		set Zeny, Zeny+.zenyPrz[(gettimetick(2)-.startTime)/60];
		warp "SavePoint",0,0;
	}
	end;


	OnActivate:
	set .min, 0;
	set $poringCmdFlag, rand(100000,999999);
	set .timerMode, 0;		//Mode 0: Start timer
	set $@isPoringCmdStart, 0;
	hideoffnpc "poringCommando";
	hideonnpc "poringCmdExit";
	//hideonnpc "poringMsg";
	announce "กิจกรรม Poring Commando ได้เปิดให้ท่านร่วมสนุกแล้ว",bc_blue|bc_all;
	maprespawnguildid $@poringCmdMap$,0,7;
	initnpctimer;
	end;

	OnTimer60000:	//1 Minute
	if(.timerMode == 0){
		set .min, .min+1;
		if(.min==.prepareTime){
			set .startTime, gettimetick(2);
			set .timerMode, 1;	//Mode 1: Respawn Check
			set .oldMin, 0;
			set $@isPoringCmdStart, 1;
			initnpctimer;
			hideonnpc "poringCommando";
			//hideoffnpc "poringMsg";
			goto OnSpawn;
		}
		else {
			announce "Poring Commando จะปิดการสมัคร และเริ่มต้นในอีก " + (.prepareTime-.min) + " นาที",bc_all,0xBFEFFF;
			initnpctimer;
		}
	}
	end;

	OnTimer300:
	if(.timerMode == 1){
		set .poringAlive, mobcount($@poringCmdMap$,"poringCommando::OnPoringDie");
		//set .poringAlive, getmapmobs($@poringCmdMap$);
		set .curMin, (gettimetick(2)-.startTime)/60;
		if(.oldMin != .curMin){
			set .oldMin, .curMin;
			mapannounce $@poringCmdMap$, "ขณะนี้ผู้เล่นทั้งหมด " + getmapusers($@poringCmdMap$) + " ท่าน รอดชีวิตมาได้แล้ว " + .curMin + " นาที",  bc_map,0xBFEFFF;
			if(.@curMin%3 == 0)
				killmonsterall $@poringCmdMap$;
		}
		set .@end, 0;
		if(.curMin >= .maxMin) set .@end, 1;
		else if(getmapusers($@poringCmdMap$)==0) set .@end, 2;
		if(.@end){
			switch(.@end){
				case 1:
				announce "ผู้เล่นทั้งหมด " + getmapusers($@poringCmdMap$) + " ท่านได้อยู่รอดจนครบ " + .maxMin + " นาทีแล้ว!! ขอแสดงความยินดี ด้วย!!", bc_all;
				set Zeny, Zeny+$@maxPrize;
				break;

				case 2:
				announce "ผู้เล่นทั้งหมด ได้พ่ายแพ้ต่อฝูงพอริ่งแล้ว !! w(-,,-)w",bc_all;
				set Zeny, Zeny+$@maxPrize;
				break;
			}
			killmonsterall $@poringCmdMap$;
			hideoffnpc "poringCmdExit";
			stopnpctimer;
			end;
		}
		//announce "Alive: " + .poringAlive + " Max: " + .spawnMax[.curMin], 0;
		if(.poringAlive < .spawnMax[.curMin]){
			monster $@poringCmdMap$,0,0,"Poring",.poringMobID[(.curMin/3)],1,"poringCommando::OnPoringDie";
			//areamonster $@poringCmdMap$,33,33,58,58,"Poring",.poringMobID[(.curMin/3)],1,"poringCommando::OnPoringDie";
		}
		initnpctimer;
	}
	end;
	OnClock1300:
	OnClock1433:
	OnClock1442:
	OnClock1512:
	OnClock1524:
	OnClock1800:
	OnClock2100:
	//OnClock1500:
	//OnClock2100:
	//OnClock0000:
		donpcevent "poringCommando::OnActivate";
	end;

	OnInit:
	hideonnpc "poringCommando";
	set .name$, "[ ^FF0000Poring Commando^000000 ]";
	set $poringCmdFlag, rand(100000,999999);
	set .timerMode, 0;

	//Set เงิน ที่ใช้เข้ากิจกรรม
	set .zenyReq, 5000;

	//เงิน ที่ได้รับในนาทีต่างๆ (หน่วยเป็น 1 ชิ้น)
	setarray .zenyPrz[0],0,25000,50000,80000,100000,200000,300000,400000,500000,600000,700000,800000,1000000,3000000,4000000,5000000;	//1-15

	//จำนวนพอริ่งที่ต้องการให้เงินในแต่ละนาที
	setarray .spawnMax[0],80,80,80,80,100,100,100,100,100,300,400,500,500,800,1000;	//1-15

	//แผนที่จัดกิจกรรม
	set $@poringCmdMap$,"guild_vs5.gat";	
	
	//เวลาลงทะเบียน ก่อนเริ่มกิจกรรม (หน่วยเป็นนาที)
	set .prepareTime, 3;
	set .maxMin, getarraysize(.zenyPrz);
	set $@maxPrize, .zenyPrz[.maxMin-1];

	//Poring Mob Type
	//1: Very Easy Poring (0~3)
	//2: Easy Poring (4~6)
	//3: Normal Poring (7~9)
	//4: Hard Poring (10~12)
	//5: Very Hard Poring (13~15)
	setarray .poringMobID[0],3800,3801,3802,3803,1904;	//5 Levels of porings  รหัสมอนสเตอร์พอริ่ง

	//Mapflag conf
	setmapflag $@poringCmdMap$,mf_nomemo;
	setmapflag $@poringCmdMap$,mf_noteleport;
	setmapflag $@poringCmdMap$,mf_nosave;
	setmapflag $@poringCmdMap$,mf_nobranch;
	setmapflag $@poringCmdMap$,mf_nopenalty;
	setmapflag $@poringCmdMap$,mf_nozenypenalty;
	setmapflag $@poringCmdMap$,mf_noskill;
	removemapflag $@poringCmdMap$,mf_gvg;
	end;
}

//npc ทางออก
guild_vs5,44,71,4	script	ทางออกกิจกรรม::poringCmdExit	1002,{
	if(poringCmdFlag){
		set .name$, "[ ^FF0000Poring^000000 ]";
		mes "ยินดีด้วย ท่านรอดมาจนครบ";
		mes "จำนวนนาทีสูงสุดแล้ว!!";
		mes "เอาล่ะ นี่คือ เงิน รางวัลของท่าน";
		mes "^0000FF*ได้รับ " + ($@maxPrize) + "z";
		set Zeny, Zeny+$@maxPrize;
		set poringCmdFlag, 0;
		close2;
	}
	warp "SavePoint",0,0;
	end;
}

-	script	PoringCP	-1,{
	OnWhisperGlobal:
	if(getgmlevel() < 80) end;
	if(@whispervar0$ == "1")
		donpcevent "poringCommando::OnActivate";
	end;
}

morocc,190,112,4	script	Poring Commando	440,{

		mes "[ ^FF0000วิธีการเล่น Poring^000000 ]";
		mes "ค่าสมัครเล่น ^FF00005k^000000";
		mes "อ่านรายละเอียดได้ในกิจกรรม";
		mes "ยิ่งอยู่นานยิ่งได้รางวัลเยอะ";
		mes "เวลาสูงสุดคือ ^FF000015^000000 นาที ได้ ^FF00002m^000000";
		mes "เวลา กิจกรรมของ Poring คือ";
		mes "^FF0000013.00 , 18.00 , 21.00^000000";
		end;
		OnInit:
		waitingroom	"Poring Commando",0;
	end;
}

// -- Mapflags 
guild_vs5	mapflag	nowarp
guild_vs5	mapflag	nowarpto
guild_vs5	mapflag	noteleport
guild_vs5	mapflag	monster_noteleport
guild_vs5	mapflag	nosave	SavePoint
guild_vs5	mapflag	nomemo
guild_vs5	mapflag	nobranch
guild_vs5	mapflag	nopenalty
guild_vs5	mapflag	noreturn

Could you help me please 

please check my event script ( Poringcommando)

this function do not work 

OnPCDieEvent:
	getmapxy .@map$, .@x, .@y, 0;
	//announce .@map$ + "," + $@poringCmdMap$ + "," + poringCmdFlag + "," + $poringCmdFlag, 16;
	if(.@map$ == $@poringCmdMap$ && poringCmdFlag == $poringCmdFlag){
		mapannounce $@poringCmdMap$, "ผู้เล่น " + strcharinfo(0) + " ได้พ่ายแพ้ต่อฝูง Poring แล้ว ได้รับ เงิน รางวัล " + (.zenyPrz[(gettimetick(2)-.startTime)/60]) +  " เงิน", bc_map,0xFF0000;
		set Zeny, Zeny+.zenyPrz[(gettimetick(2)-.startTime)/60];
		warp "SavePoint",0,0;
	}

thank you.

4 answers to this question

Recommended Posts

  • 0
Posted
1 hour ago, Start_ said:

change


getmapxy .@map$, .@x, .@y, 0;

to


getmapxy(.@map$,.@x,.@y);

 

when i change this it do not work 

this function when i loss for event 

i must get a zeny for tim use

thank you

  • 0
Posted

Hello,

Do you have any error trigerring?
Try this even if I don't think it'll help?

getmapxy(.@map$,.@x,.@y,BL_PC);

Does your announce print anything uncommented?

  • 0
Posted
12 minutes ago, Kreustoo said:

Hello,

Do you have any error trigerring?
Try this even if I don't think it'll help?


getmapxy(.@map$,.@x,.@y,BL_PC);

Does your announce print anything uncommented?

I don't get error and function do not work agian

but when charactor dead not get zeny and not warp to save point 

i think function if do not work 

if(.@map$ == $@poringCmdMap$ && poringCmdFlag == $poringCmdFlag){
		mapannounce $@poringCmdMap$, " client " + strcharinfo(0) + " will loss Poring and get money " + (.zenyPrz[(gettimetick(2)-.startTime)/60]) +  " money", bc_map,0xFF0000;
		set Zeny, Zeny+.zenyPrz[(gettimetick(2)-.startTime)/60];
		warp "SavePoint",0,0;

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...