pastebin - collaborative debugging tool
kpaste.net RSS

Difference between
modified post c63935c32 by Anonymous on Fri 1st Jun 2012 06:12
original post 13cbbefd by Anonymous on Fri 1st Jun 2012 05:24
Download diff
Show old version | new version | both versions

    
11
//=========================================
22
//By : goddameit
33
//Ver : 3
44
//=========================================
55
prontera,157,185,4	script	Warp Battle Ground Vg	100,{
66
	warp "pvp_room",80,43;
77
	end;
88
}
99
1010
//=======================================================================//
1111
//===============================Register================================//
1212
//=======================================================================//
1313
pvp_room,87,38,4	script	Battleground Vg#1	100,{
1414
	end;
1515
OnInitC:
1616
	if(!.k){end;}
1717
	enablenpc strnpcinfo(0);
1818
	waitingroom "Battle Ground",getvariableofnpc(.gameplayeramount,"batleVg"),"Battleground Vg#1::OnJoin",getvariableofnpc(.gameplayeramount,"batleVg");
1919
	end;
2020
OnJoin:
2121
	if(getvariableofnpc(.game,"batleVg")==3){
2222
		mapannounce "pvp_room","[Battle Ground System] Wait for game over completely.",0;
2323
		end;
2424
	}
2525
	set .k,0;
2626
	set $bgvgbid1,waitingroom2bg("bat_b01",87,75,"","batleVg::OnGu1Die");
2727
	warpwaitingpc "bat_b01",87,75;
2828
	delwaitingroom;
2929
	disablenpc strnpcinfo(0);
3030
	set getvariableofnpc(.game,"batleVg"),getvariableofnpc(.game,"batleVg")+1;
3131
	if(getvariableofnpc(.game,"batleVg")==1){
3232
		donpcevent "batleVg::OnGameStart";
3333
	}
3434
	end;
3535
OnPCLoadMapEvent:
3636
	if(getcharid(4)){
3737
		bg_leave;
3838
		dispbottom "=======================================";
3939
		dispbottom "================[Leave]================";
4040
		dispbottom "=======================================";
4141
	}
4242
	end;
4343
}
4444
4545
pvp_room,72,38,4	script	Battleground Vg#2	100,{
4646
	end;
4747
OnInitC:
4848
	if(!.k){end;}
4949
	enablenpc strnpcinfo(0);
5050
	waitingroom "Battle Ground",getvariableofnpc(.gameplayeramount,"batleVg"),"Battleground Vg#2::OnJoin",getvariableofnpc(.gameplayeramount,"batleVg");
5151
	end;
5252
OnJoin:
5353
	if(getvariableofnpc(.game,"batleVg")==3){
5454
		mapannounce "pvp_room","[Battle Ground System] Wait for game over completely.",0;
5555
		end;
5656
	}
5757
	set .k,0;
5858
	set $bgvgbid2,waitingroom2bg("bat_b01",311,224,"","batleVg::OnGu2Die");
5959
	warpwaitingpc "bat_b01",311,224;
6060
	delwaitingroom;
6161
	disablenpc strnpcinfo(0);
6262
	set getvariableofnpc(.game,"batleVg"),getvariableofnpc(.game,"batleVg")+1;
6363
	if(getvariableofnpc(.game,"batleVg")==1){
6464
		donpcevent "batleVg::OnGameStart";
6565
	}
6666
	end;
6767
}
6868
6969
//=======================================================================//
7070
//================================Set====================================//
7171
//=======================================================================//
7272
-	script	batleVg	-1,{
7373
ii:
7474
	setarray .hpto,50,50,10000,90000,10000;	//HP of Ground 1 , HP of Ground 2 , time 1(Register) , time 2(During) , time 3(Respwan)
7575
	if(!getvariableofnpc(.k,"Battleground Vg#2")){
7676
		set getvariableofnpc(.k,"Battleground Vg#2"),1;
7777
		donpcevent "Battleground Vg#2::OnInitC";
7878
	}
7979
	if(!getvariableofnpc(.k,"Battleground Vg#1")){
8080
		set getvariableofnpc(.k,"Battleground Vg#1"),1;
8181
		donpcevent "Battleground Vg#1::OnInitC";
8282
	}
8383
	set .game,0;
8484
	killmonsterall "bat_b01";
85-
	mapwarp "bat_b01","prontera",150,180;
85+
	mapwarp "bat_b01","bat_b01",10,290;
8686
	return;
8787
OnInit:
8888
	set .gameplayeramount,1;
8989
	callsub ii;
9090
	//=======================================================================//
9191
	//===============================SetWall=================================//
9292
	//=======================================================================//
9393
	setwall "bat_b01",327,173,5,6,1,"battleground Vg wall 1";
9494
	setwall "bat_b01",332,172,2,6,1,"battleground Vg wall 2";
9595
	setwall "bat_b01",244,185,3,4,1,"battleground Vg wall 3";
9696
	setwall "bat_b01",244,182,4,6,1,"battleground Vg wall 4";
9797
	setwall "bat_b01",67,128,10,1,1,"battleground Vg wall 5";
9898
	setwall "bat_b01",152,118,4,6,1,"battleground Vg wall 6";
9999
	setwall "bat_b01",156,118,5,4,1,"battleground Vg wall 7";
100100
	disablenpc "battleground Vg warp 1";
101101
	disablenpc "battleground Vg warp 2";
102102
	disablenpc "battleground Vg warp 3";
103103
	disablenpc "battleground Vg warp 4";
104104
	end;
105105
	//=======================================================================//
106106
	//================================Control================================//
107107
	//=======================================================================//
108108
OnGameStart:
109109
	bg_updatescore "bat_b01",.hpto[0],.hpto[1];
110-
	mapwarp "bat_b01","prontera",150,180;
110+
	mapwarp "bat_b01","bat_b01",10,290;
111111
	setarray .@k,gettime(3),gettime(2),gettime(1)+.hpto[2]/1000;
112112
	while(.@k[2]>=60){
113113
		if(.@k[2]>=60){
114114
			setarray .@k[1],.@k[1]+1,.@k[2]-60;
115115
		}
116116
		if(.@k[1]>=60){
117117
			setarray .@k[0],.@k[0]+1,.@k[1]-60;
118118
		}
119119
		if(.@k[0]>=24){
120120
			set .@k[0],.@k[0]-24;
121121
		}
122122
	}
123123
	announce "[Battle Ground System] Will Start at "+.@k[0]+":"+.@k[1]+":"+.@k[2]+" !",0;
124124
	sleep(.hpto[2]);
125125
OnTimerC:
126126
	if(.game!=2){
127127
		sleep(2000);
128128
		if(.game){
129129
			announce "[Battle Ground System] Game Over.",0;
130130
		}
131131
		callsub ii;
132132
		end;
133133
	}
134134
	announce "[Battle Ground System] Go !",0;
135135
	set .ib2,bg_monster($bgvgbid2,"bat_b01",326,149," ",1956,"batleVg::OnKiillT2");
136136
	set .ib1,bg_monster($bgvgbid1,"bat_b01",61,149," ",1916,"batleVg::OnKiillT1");
137137
	enablenpc "battleground Vg warp 1";
138138
	enablenpc "battleground Vg warp 2";
139139
	enablenpc "battleground Vg warp 3";
140140
	enablenpc "battleground Vg warp 4";
141141
	initnpctimer "#bgvg_heal1";
142142
	//=======================================================================//
143143
	//=================================OnEnd=================================//
144144
	//=======================================================================//
145145
OnTimerB:
146146
	sleep(.hpto[3]);
147147
	if(.hpto[0]>.hpto[1]){
148148
		set .@c4,1;
149149
	}else if(.hpto[0]<.hpto[1]){
150150
		set .@c4,2;
151151
	}
152-
	announce "[Battle Ground System] Ground "+(.@c4?.@c4+" Win":"Tie")+" !",0;
152+
	announce "[Battle Ground System] Ground "+(.@c4 ? .@c4+" Win" : "Tie")+" !",0;
153153
	callsub ii;
154154
	end;
155155
	//=======================================================================//
156156
	//================================OnBreak================================//
157157
	//=======================================================================//
158158
OnKiillT2:
159159
	bg_warp $bgvgbid1,"bat_b01",87,75;
160160
	bg_warp $bgvgbid2,"bat_b01",311,224;
161161
	bg_updatescore "bat_b01",set(.hpto[0],.hpto[0]+3),set(.hpto[1],.hpto[1]-5);
162162
	if(.hpto[0]>99){
163163
		bg_updatescore "bat_b01",99,.hpto[1];
164164
	}
165165
	sleep(.hpto[4]);
166166
	set .ib2,bg_monster($bgvgbid2,"bat_b01",326,149," ",1956,"batleVg::OnKiillT2");
167167
	end;
168168
OnKiillT1:
169169
	bg_warp $bgvgbid1,"bat_b01",87,75;
170170
	bg_warp $bgvgbid2,"bat_b01",311,224;
171171
	bg_updatescore "bat_b01",set(.hpto[0],.hpto[0]-5),set(.hpto[1],.hpto[1]+3);
172172
	if(.hpto[1]>99){
173173
		bg_updatescore "bat_b01",.hpto[0],99;
174174
	}
175175
	sleep(.hpto[4]);
176176
	set .ib1,bg_monster($bgvgbid1,"bat_b01",61,149," ",1916,"batleVg::OnKiillT1");
177177
	end;
178178
	//=======================================================================//
179179
	//=================================OnDie=================================//
180180
	//=======================================================================//
181181
OnGu1Die:
182182
OnGu2Die:
183183
	getmapxy(@n$,@n,@b,0);
184184
	if((getcharid(4)!=$bgvgbid2&&getcharid(4)!=$bgvgbid1)||@n$!="bat_b01"){
185185
		set @n$,"";set @n,0; set @b,0;
186186
		end;
187187
	}
188188
	if(getcharid(4)==$bgvgbid2){
189189
		set .hpto[1],.hpto[1]-1;
190190
	}else{
191191
		set .hpto[0],.hpto[0]-1;
192192
	}
193193
	if(.hpto[1]>99){
194194
		set .hpto[1],99;
195195
	}
196196
	if(.hpto[1]<0){
197197
		set .winn,1;
198198
		set .hpto[1],0;
199199
	}
200200
	if(.hpto[0]>99){
201201
		set .hpto[0],99;
202202
	}
203203
	if(.hpto[0]<0){
204204
		set .winn,2;
205205
		set .hpto[0],0;
206206
	}
207207
	bg_updatescore "bat_b01",.hpto[0],.hpto[1];
208208
	if(.winn){
209209
		announce "[Battle Ground System] Ground "+.winn+" Win !",0;
210210
		sleep 1000;
211211
		callsub ii;
212-
		mapwarp "bat_b01","prontera",150,180;
212+
		mapwarp "bat_b01","bat_b01",10,290;
213213
		set .game,3;
214214
	}
215215
	end;
216216
}
217217
218218
//=======================================================================//
219219
//==================================Heal=================================//
220220
//=======================================================================//
221221
bat_b01,311,224,4	script	#bgvg_heal1	139,{
222222
OnTimer2000:
223223
	unitwarp .ib2,"bat_b01",326,149;
224224
	unitwarp .ib1,"bat_b01",61,149;
225225
	if(getvariableofnpc(.game,"batleVg")==2){
226226
		unitwarp .ib1,"bat_b01",61,149;
227227
		unitwarp .ib2,"bat_b01",326,149;
228228
		specialeffect 573;
229229
		donpcevent "#bgvg_heal2::OnDo";
230230
		areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
231231
		areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
232232
		sleep(1000);
233233
		areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
234234
		areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
235235
		sleep(1000);
236236
		areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
237237
		areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
238238
		sleep(1000);
239239
		areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
240240
		areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
241241
		sleep(1000);
242242
		areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
243243
		areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
244244
		sleep(1000);
245245
		areapercentheal "bat_b01",301,214,321,234,1+rand(2),1+rand(2);
246246
		areapercentheal "bat_b01",77,65,97,85,1+rand(2),1+rand(2);
247247
		sleep(1000);
248248
		initnpctimer;
249249
	}else{
250250
		stopnpctimer;
251251
	}
252252
	end;
253253
}
254254
255255
bat_b01,87,75,4	script	#bgvg_heal2	139,{
256256
OnDo:
257257
	specialeffect 573;
258258
	end;
259259
}
260260
261261
//=======================================================================//
262262
//==================================Warp=================================//
263263
//=======================================================================//
264264
bat_b01,338,226,0	warp	battleground Vg warp 1	2,2,bat_b01,331,170
265265
bat_b01,286,228,0	warp	battleground Vg warp 2	2,2,bat_b01,242,179
266266
bat_b01,61,73,0	warp	battleground Vg warp 3	2,2,bat_b01,65,133
267267
bat_b01,114,72,0	warp	battleground Vg warp 4	2,2,bat_b01,154,122
268268
bat_b01,199,119,0	script	#battleground Vg warp 5	45,2,2,{
269269
	if(getcharid(4)!=$bgvgbid1){end;}
270270
	warp "bat_b01",87,75;
271271
	end;
272272
}
273273
bat_b01,199,181,0	script	#battleground Vg warp 6	45,2,2,{
274274
	if(getcharid(4)!=$bgvgbid2){end;}
275275
	warp "bat_b01",311,224;
276276
	end;
277277
}
278278
279-
//=======================================================================//
279+
//=========================================================
280-
//================================Mapflag================================//
280+
// Exit NPC that also gives prizes
281-
//=======================================================================//
281+
//=========================================================
282-
bat_b01	mapflag	battleground	2
282+
bat_b01,10,294,3	script	BG Exit	934,{
283-
bat_b01	mapflag	nomemo
283+
	mes "[Battlegrounds]";
284-
bat_b01	mapflag	nosave	SavePoint
284+
	if (getcharid(4)) {
285-
bat_b01	mapflag	noteleport
285+
		if (getcharid(4) == getd("$bgvgbid"+.winn)) {
286-
bat_b01	mapflag	nowarp
286+
			// Winning Team
287-
bat_b01	mapflag	nowarpto
287+
			mes "Let's enjoy our glorious victory!";
288-
bat_b01	mapflag	noreturn
288+
			close2;
289-
bat_b01	mapflag	nobranch
289+
			getitem 7829, 10; // Valor Badge
290-
bat_b01	mapflag	nopenalty
290+
		} else {
291-
bat_b01	mapflag	monster_noteleport
291+
			// Losing Team
292-
pvp_room	mapflag	loadevent
292+
			mes "You lost, but you're dedicated to this battle.";
293+
			close2;
293296
297+
		bg_leave;
294305
//=======================================================================//
295-
//===============================Function================================//
306+
//================================Mapflag================================//
296307
//=======================================================================//
297-
function	script	BattleGroundVgFunction	{
308+
bat_b01	mapflag	battleground	2
298-
	getmapxy(@m$,@x,@y,0);
309+
bat_b01	mapflag	nomemo
299-
	if(getcharid(4)!=$bgvgbid1&&getcharid(4)!=$bgvgbid2&&@m$!="bat_b01"){
310+
bat_b01	mapflag	nosave	SavePoint
300-
		dispbottom "[You can't use this item]";
311+
bat_b01	mapflag	noteleport
301-
		end;
312+
bat_b01	mapflag	nowarp
302-
	}
313+
bat_b01	mapflag	nowarpto
303-
	bg_warp getcharid(4),@m$,@x,@y;
314+
bat_b01	mapflag	noreturn
304-
	end;
315+
bat_b01	mapflag	nobranch
305-
}
316+
bat_b01	mapflag	nopenalty
306-
317+
bat_b01	mapflag	monster_noteleport
307-
318+
pvp_room	mapflag	loadevent
308319
309-
320+
//=======================================================================//
310-
321+
//===============================Function================================//
311-
322+
//=======================================================================//
312-
323+
function	script	BattleGroundVgFunction	{
313-
324+
	getmapxy(@m$,@x,@y,0);
314-
325+
	if(getcharid(4)!=$bgvgbid1&&getcharid(4)!=$bgvgbid2&&@m$!="bat_b01"){
315-
326+
		dispbottom "[You can't use this item]";
316-
327+
		end;
317-
328+
	}
318-
329+
	bg_warp getcharid(4),@m$,@x,@y;
319-
330+
	end;
320-
331+
}
321332

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at