Jump to content
  • 0

How to fix this bug script


Famous

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

Every time the guild master talk to the npc and get reward he gets 7pcs castle drop it should be one pcs only and once the guildmaster relog and talk again to the npc he will recieve again the castle drop how to change it that when the guild master relog he already recieve the castle drop.......

 

 

 

/*
15,prtg_cas01,Kriemhild,Agit#prtg_cas01,1			// kRO : Creamhilt
16,prtg_cas02,Swanhild,Agit#prtg_cas02,1			// kRO : Sbanhealt
17,prtg_cas03,Fadhgridh,Agit#prtg_cas03,1			// kRO : Lazrigees
18,prtg_cas04,Skoegul,Agit#prtg_cas04,1			// kRO : Squagul
19,prtg_cas05,Gondul,Agit#prtg_cas05,1			// kRO : Guindull
prontera castles ... so only need to use agitcheck(), not agitcheck2()
*/
prtg_cas01,15,209,5	script	Prontera Castles	899,{
//	setcastledata "prtg_cas05", 1, getcharid(2); // just testing ..
	if ( agitcheck() ) {
		mes "a war is currently in progress";
		mes "if your guild owned a castle ask your guild master to see me to claim the reward";
		close;
	}
	set .@menu, select(.menu$) -1;
	if ( getcastledata("prtg_cas0"+( .@menu +1 ), 1) == getcharid(2) ) {
		if ( $castle_claimed & pow(2, .@menu) ) {
			mes "your guild already received the reward for "+ .castlename$[.@menu];
			close;
		}
		else if ( getguildmasterid( getcharid(2) ) == getcharid(0) ) {
			mes "receiving the reward for "+ .castlename$[.@menu];
			getitem 7091, 1 * (10 - .@menu); // some mathematics ...
			set $castle_claimed, $castle_claimed | pow(2, .@menu);
			close;
		}
		else {
			mes "ask your guild master to see me";
			close;
		}
	}
	mes "your guild failed to take "+ .castlename$[.@menu];
	mes "if your guild owned a castle ask your guild master to claim reward from me";
	close;
OnAgitEnd:
	set $castle_claimed, 0; // everytime woe ends the variable resets
	end;
OnInit:
	setarray .castlename$, "Kriemhild", "Swanhild", "Fadhgridh", "Skoegul", "Gondul";
	for ( set .@i, 0; .@i < 5; set .@i, .@i +1 )
		set .menu$, .menu$ + .castlename$[.@i] +":";
}

/*
0,aldeg_cas01,Neuschwanstein,Agit#aldeg_cas01,1
1,aldeg_cas02,Hohenschwangau,Agit#aldeg_cas02,1
2,aldeg_cas03,Nuenberg,Agit#aldeg_cas03,1
3,aldeg_cas04,Wuerzburg,Agit#aldeg_cas04,1
4,aldeg_cas05,Rothenburg,Agit#aldeg_cas05,1
aldebaran castles ... so only need to use agitcheck(), not agitcheck2()
*/
aldeg_cas02,134,225,5	script	Aldebaran Castles	899,{
//	setcastledata "aldeg_cas05", 1, getcharid(2); // just testing ..
	if ( agitcheck() ) {
		mes "a war is currently in progress";
		mes "if your guild owned a castle ask your guild master to see me to claim the reward";
		close;
	}
	set .@menu, select(.menu$) -1;
	if ( getcastledata("aldeg_cas0"+( .@menu +1 ), 1) == getcharid(2) ) {
		if ( $castle_claimed & pow(2, .@menu) ) {
			mes "your guild already received the reward for "+ .castlename$[.@menu];
			close;
		}
		else if ( getguildmasterid( getcharid(2) ) == getcharid(0) ) {
			mes "receiving the reward for "+ .castlename$[.@menu];
			getitem 7090, 1 * (10 - .@menu); // some mathematics ...
			set $castle_claimed, $castle_claimed | pow(2, .@menu);
			close;
		}
		else {
			mes "ask your guild master to see me";
			close;
		}
	}
	mes "your guild failed to take "+ .castlename$[.@menu];
	mes "if your guild owned a castle ask your guild master to claim reward from me";
	close;
OnAgitEnd:
	set $castle_claimed, 0; // everytime woe ends the variable resets
	end;
OnInit:
	setarray .castlename$, "Neuschwanstein", "Hohenschwangaud", "Nuenberg", "Wuerzburgl", "Rothenburgl";
	for ( set .@i, 0; .@i < 5; set .@i, .@i +1 )
		set .menu$, .menu$ + .castlename$[.@i] +":";
}

/*
5,gefg_cas01,Repherion,Agit#gefg_cas01,1
6,gefg_cas02,Eeyolbriggar,Agit#gefg_cas02,1
7,gefg_cas03,Yesnelph,Agit#gefg_cas03,1
8,gefg_cas04,Bergel,Agit#gefg_cas04,1
9,gefg_cas05,Mersetzdeitz,Agit#gefg_cas05,1
geffen castles ... so only need to use agitcheck(), not agitcheck2()
*/
gefg_cas01,152,117,5	script	Geffen Castles	899,{
//	setcastledata "gefg_cas05", 1, getcharid(2); // just testing ..
	if ( agitcheck() ) {
		mes "a war is currently in progress";
		mes "if your guild owned a castle ask your guild master to see me to claim the reward";
		close;
	}
	set .@menu, select(.menu$) -1;
	if ( getcastledata("gefg_cas0"+( .@menu +1 ), 1) == getcharid(2) ) {
		if ( $castle_claimed & pow(2, .@menu) ) {
			mes "your guild already received the reward for "+ .castlename$[.@menu];
			close;
		}
		else if ( getguildmasterid( getcharid(2) ) == getcharid(0) ) {
			mes "receiving the reward for "+ .castlename$[.@menu];
			getitem 7078, 1 * (10 - .@menu); // some mathematics ...
			set $castle_claimed, $castle_claimed | pow(2, .@menu);
			close;
		}
		else {
			mes "ask your guild master to see me";
			close;
		}
	}
	mes "your guild failed to take "+ .castlename$[.@menu];
	mes "if your guild owned a castle ask your guild master to claim reward from me";
	close;
OnAgitEnd:
	set $castle_claimed, 0; // everytime woe ends the variable resets
	end;
OnInit:
	setarray .castlename$, "Repherion", "Eeyolbriggar", "Yesnelph", "Bergel", "Mersetzdeitz";
	for ( set .@i, 0; .@i < 5; set .@i, .@i +1 )
		set .menu$, .menu$ + .castlename$[.@i] +":";
}


/*
10,payg_cas01,Bright Arbor,Agit#payg_cas01,1
11,payg_cas02,Scarlet Palace,Agit#payg_cas02,1
12,payg_cas03,Holy Shadow,Agit#payg_cas03,1
13,payg_cas04,Sacred Altar,Agit#payg_cas04,1
14,payg_cas05,Bamboo Grove Hill,Agit#payg_cas05,1
Payon castles ... so only need to use agitcheck(), not agitcheck2()
*/
payg_cas01,295,8,5	script	Payon Castles	899,{
//	setcastledata "payg_cas05", 1, getcharid(2); // just testing ..
	if ( agitcheck() ) {
		mes "a war is currently in progress";
		mes "if your guild owned a castle ask your guild master to see me to claim the reward";
		close;
	}
	set .@menu, select(.menu$) -1;
	if ( getcastledata("payg_cas0"+( .@menu +1 ), 1) == getcharid(2) ) {
		if ( $castle_claimed & pow(2, .@menu) ) {
			mes "your guild already received the reward for "+ .castlename$[.@menu];
			close;
		}
		else if ( getguildmasterid( getcharid(2) ) == getcharid(0) ) {
			mes "receiving the reward for "+ .castlename$[.@menu];
			getitem 7077, 1 * (10 - .@menu); // some mathematics ...
			set $castle_claimed, $castle_claimed | pow(2, .@menu);
			close;
		}
		else {
			mes "ask your guild master to see me";
			close;
		}
	}
	mes "your guild failed to take "+ .castlename$[.@menu];
	mes "if your guild owned a castle ask your guild master to claim reward from me";
	close;
OnAgitEnd:
	set $castle_claimed, 0; // everytime woe ends the variable resets
	end;
OnInit:
	setarray .castlename$, "Bright Arbor", "Scarlet Palace", "Holy Shadow", "Bergel", "Bamboo Grove Hill";
	for ( set .@i, 0; .@i < 5; set .@i, .@i +1 )
		set .menu$, .menu$ + .castlename$[.@i] +":";
}


/*
15,arug_cas01,arunafelts castle 1,Agit#arug_cas01,1
16,arug_cas02,arunafelts castle 2,Agit#arug_cas02,1
17,arug_cas03,arunafelts castle 3,Agit#arug_cas03,1
18,arug_cas04,arunafelts castle 4,Agit#arug_cas04,1
19,arug_cas05,arunafelts castle 5,Agit#arug_cas05,1
arunafelts castles ... so only need to use agitcheck(), not agitcheck2()
*/
aru_gld,158,274,5	script	Arunafelts Castles	899,{
//	setcastledata "arug_cas05", 1, getcharid(2); // just testing ..
	if ( agitcheck() ) {
		mes "a war is currently in progress";
		mes "if your guild owned a castle ask your guild master to see me to claim the reward";
		close;
	}
	set .@menu, select(.menu$) -1;
	if ( getcastledata("arug_cas0"+( .@menu +1 ), 1) == getcharid(2) ) {
		if ( $castle_claimed & pow(2, .@menu) ) {
			mes "your guild already received the reward for "+ .castlename$[.@menu];
			close;
		}
		else if ( getguildmasterid( getcharid(2) ) == getcharid(0) ) {
			mes "receiving the reward for "+ .castlename$[.@menu];
			getitem 7086, 1 * (10 - .@menu); // some mathematics ...
			set $castle_claimed, $castle_claimed | pow(2, .@menu);
			close;
		}
		else {
			mes "ask your guild master to see me";
			close;
		}
	}
	mes "your guild failed to take "+ .castlename$[.@menu];
	mes "if your guild owned a castle ask your guild master to claim reward from me";
	close;
OnAgitEnd:
	set $castle_claimed, 0; // everytime woe ends the variable resets
	end;
OnInit:
	setarray .castlename$, "arunafelts castle 1", "arunafelts castle 2", "arunafelts castle 3", "arunafelts castle 4", "arunafelts castle 5";
	for ( set .@i, 0; .@i < 5; set .@i, .@i +1 )
		set .menu$, .menu$ + .castlename$[.@i] +":";
}

/*
20,schg_cas01,Schwaltzvalt castle 1,Agit#schg_cas01,1
21,schg_cas02,Schwaltzvalt castle 2,Agit#schg_cas02,1
22,schg_cas03,Schwaltzvalt castle 3,Agit#schg_cas03,1
23,schg_cas04,Schwaltzvalt castle 4,Agit#schg_cas04,1
24,schg_cas05,Schwaltzvalt castle 5,Agit#schg_cas05,1
Schwaltzvalt castles ... so only need to use agitcheck(), not agitcheck2()
*/
sch_gld,289,101,5	script	Schwaltzvalt Castles	899,{
//	setcastledata "schg_cas05", 1, getcharid(2); // just testing ..
	if ( agitcheck() ) {
		mes "a war is currently in progress";
		mes "if your guild owned a castle ask your guild master to see me to claim the reward";
		close;
	}
	set .@menu, select(.menu$) -1;
	if ( getcastledata("schg_cas0"+( .@menu +1 ), 1) == getcharid(2) ) {
		if ( $castle_claimed & pow(2, .@menu) ) {
			mes "your guild already received the reward for "+ .castlename$[.@menu];
			close;
		}
		else if ( getguildmasterid( getcharid(2) ) == getcharid(0) ) {
			mes "receiving the reward for "+ .castlename$[.@menu];
			getitem 7090, 1 * (10 - .@menu); // some mathematics ...
			set $castle_claimed, $castle_claimed | pow(2, .@menu);
			close;
		}
		else {
			mes "ask your guild master to see me";
			close;
		}
	}
	mes "your guild failed to take "+ .castlename$[.@menu];
	mes "if your guild owned a castle ask your guild master to claim reward from me";
	close;
OnAgitEnd:
	set $castle_claimed, 0; // everytime woe ends the variable resets
	end;
OnInit:
	setarray .castlename$, "Schwaltzvalt castle 1", "Schwaltzvalt castle 2", "Schwaltzvalt castle 3", "Schwaltzvalt castle 4", "Schwaltzvalt castle 5";
	for ( set .@i, 0; .@i < 5; set .@i, .@i +1 )
		set .menu$, .menu$ + .castlename$[.@i] +":";
}

aldeg_cas02,134,225,5	duplicate(Aldebaran Castles)	Aldebaran Castles#room1	899
aldeg_cas03,221,271,5	duplicate(Aldebaran Castles)	Aldebaran Castles#room2	899
aldeg_cas04,83,17,5	duplicate(Aldebaran Castles)	Aldebaran Castles#room3	899
aldeg_cas05,63,17,3	duplicate(Aldebaran Castles)	Aldebaran Castles#room4	899
gefg_cas02,137,119,5	duplicate(Geffen Castles)	Geffen Castles#room5	899
gefg_cas03,267,293,5	duplicate(Geffen Castles)	Geffen Castles#room6	899
gefg_cas04,116,123,5	duplicate(Geffen Castles)	Geffen Castles#room7	899
gefg_cas05,142,112,5	duplicate(Geffen Castles)	Geffen Castles#room8	899
payg_cas02,141,149,5	duplicate(Payon Castles)	Payon Castles#room9	899
payg_cas03,157,171,5	duplicate(Payon Castles)	Payon Castles#room10	899
payg_cas04,144,50,5	duplicate(Payon Castles)	Payon Castless#room11	899
payg_cas05,153,137,5	duplicate(Payon Castles)	Payon Castles#room12	899
prtg_cas02,199,231,5	duplicate(Prontera Castles)	Prontera Castles#room13	899
prtg_cas03,185,134,5	duplicate(Prontera Castles)	Prontera Castles#room14	899
prtg_cas04,268,163,5	duplicate(Prontera Castles)	Prontera Castles#room15	899
prtg_cas05,273,180,5	duplicate(Prontera Castles)	Prontera Castles#room16	899

sch_gld,292,247,5	duplicate(Schwaltzvalt Castles)	Schwaltzvalt Castles#room17	899
sch_gld,102,192,5	duplicate(Schwaltzvalt Castles)	Schwaltzvalt Castles#room18	899
sch_gld,69,320,5	duplicate(Schwaltzvalt Castles)	Schwaltzvalt Castles#room19	899
sch_gld,135,93,5	duplicate(Schwaltzvalt Castles)	Schwaltzvalt Castles#room20	899


aru_gld,81,43,5	duplicate(Arunafelts Castles)	Arunafelts Castles#room21	899
aru_gld,63,157,5	duplicate(Arunafelts Castles)	Arunafelts Castles#room22	899
aru_gld,300,346,5	duplicate(Arunafelts Castles)	Arunafelts Castles#room23	899
aru_gld,301,111,5	duplicate(Arunafelts Castles)	Arunafelts Castles#room24	899


Thanks you!!

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

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