Jump to content
  • 0

Hi guys i liked to add something in here


Mootie

Question


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

zhakastia,112,61,5    script    WoE Prize    835,{
if ( agitcheck() ) goto L_woeon;
menu
"Kriemhild [Primary Castle]",L_prtg_cas01;
L_prtg_cas01:
if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) goto L_not_owner;
if ( $castle_claimed[1] ) goto L_claimed;
if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;
mes "receiving the reward for this castle";
getitem 7960,200;
getitem 12103,20;
getitem 7959,20;
set $castle_claimed[1], 1;
getitem 7960,250;
getitem 12103,30;
getitem 7959,30;
set $castle_claimed[2], 2;
getitem 7960,300;
getitem 12103,40;
getitem 7959,40;
set $castle_claimed[3], 3;
close;
L_woeon:
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;
L_not_owner:
mes "Your guild failed to take this castle";
mes "If your guild owned a castle ask your guild master to claim reward from me";
close;
L_claimed:
mes "Your guild already received the reward for this castle";
close;
L_not_gm:
mes "Ask your Guild Master to see me";
close;
OnAgitEnd:
set $castle_claimed[1],
set $castle_claimed[2],
set $castle_claimed[3], 0; // everytime woe ends the variable resets
end;
OnInit:
waitingroom "Kriemhild Reward",0;
end;
}


i liked to add 2 more prize each attempt so as the script has this will be the 1st reward attempt

and how i could add 2nd attempt that reward will be increase

getitem 7960,250;
getitem 12103,30;
getitem 7959,30;

and for the 3rd attempt

getitem 7960,300;
getitem 12103,40;
getitem 7959,40;

this is for only 1 castle kriemhild

thank you...

Edited by Mootie
Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

waaa i like this kind of script ^^

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  520
  • Reputation:   64
  • Joined:  11/19/11
  • Last Seen:  

zhakastia,112,61,5 script WoE Prize 835,{
if ( agitcheck() ) goto L_woeon;
menu
"Kriemhild [Primary Castle]",L_prtg_cas01;
L_prtg_cas01:
if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) goto L_not_owner;
if ( $claimed1 > 0 || $claimed2 > 0 || $claimed3 > 0 ) goto L_claimed;
if ( $first < 1 ) goto first;
if ( $first > 0 && $second < 1 ) goto second;
if ( $second > 0 && $third < 1 ) goto third;
if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;

first:
mes "receiving the reward for this castle";
getitem 7960,200;
getitem 12103,20;
getitem 7959,20;
set $first, 1;
set $claimed1,1;
close;

second:
getitem 7960,250;
getitem 12103,30;
getitem 7959,30;
set $second,1;
set $claimed2,1;
close;

third:
getitem 7960,300;
getitem 12103,40;
getitem 7959,40;
set $third,1;
set $claimed3,1;
close;
L_woeon:
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;
L_not_owner:
mes "Your guild failed to take this castle";
mes "If your guild owned a castle ask your guild master to claim reward from me";
close;
L_claimed:
mes "Your guild already received the reward for this castle";
close;
L_not_gm:
mes "Ask your Guild Master to see me";
close;
OnAgitEnd:
set $castle_claimed[1],
set $castle_claimed[2],
set $castle_claimed[3], 0; // everytime woe ends the variable resets
end;
OnInit:
waitingroom "Kriemhild Reward",0;
end;
}

Kindly try this one, sorry I'm not that good in scripting :D. If there is a error kindly post it here. Goodluck ♥.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

hmm how about this one . I modified some of the stuff in your code Sryx :-). Even i am newbie at rathena scripting :P

zhakastia,112,61,5 script WoE Prize 835,{
set $maxclaim , 3;
if ( agitcheck() ) goto L_woeon;
menu "Kriemhild [Primary Castle]",L_prtg_cas01;

L_prtg_cas01:
if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) goto L_not_owner;
if ( $claimcount >= $maxclaim) goto L_claimed;
if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;

L_default:
mes "receiving the reward for this castle";
switch ($claimcount) {
 case 0: {
getitem 7960,200;
getitem 12103,20;
getitem 7959,20;
 }
 case 1: {
getitem 7960,250;
getitem 12103,30;
getitem 7959,30;
 }
 case 2: {
getitem 7960,300;
getitem 12103,40;
getitem 7959,40;
 }
}
set $claimcount, $claimcount + 1;
close;

L_woeon:
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;

L_not_owner:
mes "Your guild failed to take this castle";
mes "If your guild owned a castle ask your guild master to claim reward from me";
close;

L_claimed:
mes "Your guild already received the reward for this castle";
close;

L_not_gm:
mes "Ask your Guild Master to see me";
close;

OnAgitEnd:
// everytime woe ends the variable resets
set $claimcount, 0;
end;

OnInit:
waitingroom "Kriemhild Reward",0;
end;
}

Just thought that some of the variables were redundant. Also i have made it configurable (in case you wish to add more /delete one claim, you can modify the maxclaim value and modify the switch statement. Let me know if you see some issues in case you use this

Edited by Emistry
Please use [CODEBOX] or Attachments for long contents.
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

hmm how about this one . I modified some of the stuff in your code Sryx :-). Even i am newbie at rathena scripting :P

zhakastia,112,61,5 script WoE Prize 835,{
set $maxclaim , 3;
if ( agitcheck() ) goto L_woeon;
menu "Kriemhild [Primary Castle]",L_prtg_cas01;

L_prtg_cas01:
if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) goto L_not_owner;
if ( $claimcount >= $maxclaim) goto L_claimed;
if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) goto L_not_gm;

L_default:
mes "receiving the reward for this castle";
switch ($claimcount) {
 case 0: {
getitem 7960,200;
getitem 12103,20;
getitem 7959,20;
 }
 case 1: {
getitem 7960,250;
getitem 12103,30;
getitem 7959,30;
 }
 case 2: {
getitem 7960,300;
getitem 12103,40;
getitem 7959,40;
 }
}
set $claimcount, $claimcount + 1;
close;

L_woeon:
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;

L_not_owner:
mes "Your guild failed to take this castle";
mes "If your guild owned a castle ask your guild master to claim reward from me";
close;

L_claimed:
mes "Your guild already received the reward for this castle";
close;

L_not_gm:
mes "Ask your Guild Master to see me";
close;

OnAgitEnd:
// everytime woe ends the variable resets
set $claimcount, 0;
end;

OnInit:
waitingroom "Kriemhild Reward",0;
end;
}

Just thought that some of the variables were redundant. Also i have made it configurable (in case you wish to add more /delete one claim, you can modify the maxclaim value and modify the switch statement. Let me know if you see some issues in case you use this

hi mindstream just tested the script that you provide after the WOE all the items is giving...

so when the WOE ends all of those are giving

getitem 7960,200;
getitem 12103,20;
getitem 7959,20;

getitem 7960,250;
getitem 12103,30;
getitem 7959,30;

getitem 7960,300;
getitem 12103,40;
getitem 7959,40;

even sryx modified is not working nor mine o.o we need a pro scripter for this xd

Edited by Mootie
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

hahaha xD

ok...

Sryx script ...

using $first, $second, $third variable

however, that is actually not the really correct way

because if let's say, the guild "ABC" conquer the castle, claimed the $first prize

guild "DEF" conquer the castle on 2nd week, will be able to claimed the $second prize without even go through 1st set of reward

and also, this part will definitely throw error

OnAgitEnd:
   set $castle_claimed[1],
   set $castle_claimed[2],
   set $castle_claimed[3], 0; // everytime woe ends the variable resets

make sure every sentence is enclosed with ";" semi-colon symbol

mindstream script ...

script might be working, but doesn't work to the concept of topic starter

I believe what he is saying means

if guild "ABC" conquer the castle for on the 1st week, can get 1st set of reward

if guild "ABC" conquer that castle again on the 2nd week, then able to get 2nd set of the reward

your script there actually allow the guild "ABC" able to reward 3 sets of reward in 1st try lol

if I do this, I'll make use of SQL table instead of saving it with global permanent variable

because if using global permanent variable, need to do something like

setd "castle_claimed"+ getcharid(2), getd( "castle_claimed"+ getcharid(2) ) + 1;

if ( getd( "castle_claimed"+ getcharid(2) ) == 1 ) < claim 1st set of reward >

if ( getd( "castle_claimed"+ getcharid(2) ) == 2 ) < claim 2nd set of reward >

if ( getd( "castle_claimed"+ getcharid(2) ) >= 3 ) < claim 3rd set of reward >

which might actually able to build up quite a ton of variables in `mapreg` table

/*
create table castle_reward (
guild_id int(11) primary key,
claimed int(11)
); engine = innodb;
*/
prontera,156,177,5    script    WoE Prize    100,{
   setcastledata "prtg_cas01", 1, getcharid(2); // debug
   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;
   }
   select "Kriemhild [Primary Castle]";
   if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) {
       mes "Your guild failed to take this castle";
       close;
   }
   if ( $castle_claimed[1] ) {
       mes "Your guild already received the reward for this castle";
       close;
   }
   if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {
       mes "Ask your Guild Master to see me";
       close;
   }
   mes "receiving the reward for this castle";
   query_sql "select claimed from castle_reward where guild_id = "+ getcharid(2), .@claimed;
   if ( !.@claimed ) { // 1st time
       getitem 7960,200;
       getitem 12103,20;
       getitem 7959,20;
   }
   else if ( .@claimed == 1 ) { // 2nd time
       getitem 7960,250;
       getitem 12103,30;
       getitem 7959,30;
   }
   else { // 3rd time onwards
       getitem 7960,300;
       getitem 12103,40;
       getitem 7959,40;
   }
   set $castle_claimed[1], 1;
   query_sql "insert into castle_reward values ( "+ getcharid(2) +", 1 ) on duplicate key update claimed = claimed +1";
   close;
OnAgitEnd:
   set $castle_claimed[1], 0; // everytime woe ends the variable resets
   end;
OnInit:
   waitingroom "Kriemhild Reward",0;
   end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

hahaha xD

ok...

Sryx script ...

using $first, $second, $third variable

however, that is actually not the really correct way

because if let's say, the guild "ABC" conquer the castle, claimed the $first prize

guild "DEF" conquer the castle on 2nd week, will be able to claimed the $second prize without even go through 1st set of reward

and also, this part will definitely throw error

OnAgitEnd:
set $castle_claimed[1],
set $castle_claimed[2],
set $castle_claimed[3], 0; // everytime woe ends the variable resets

make sure every sentence is enclosed with ";" semi-colon symbol

mindstream script ...

script might be working, but doesn't work to the concept of topic starter

I believe what he is saying means

if guild "ABC" conquer the castle for on the 1st week, can get 1st set of reward

if guild "ABC" conquer that castle again on the 2nd week, then able to get 2nd set of the reward

your script there actually allow the guild "ABC" able to reward 3 sets of reward in 1st try lol

if I do this, I'll make use of SQL table instead of saving it with global permanent variable

because if using global permanent variable, need to do something like

setd "castle_claimed"+ getcharid(2), getd( "castle_claimed"+ getcharid(2) ) + 1;

if ( getd( "castle_claimed"+ getcharid(2) ) == 1 ) < claim 1st set of reward >

if ( getd( "castle_claimed"+ getcharid(2) ) == 2 ) < claim 2nd set of reward >

if ( getd( "castle_claimed"+ getcharid(2) ) >= 3 ) < claim 3rd set of reward >

which might actually able to build up quite a ton of variables in `mapreg` table

/*
create table castle_reward (
guild_id int(11) primary key,
claimed int(11)
); engine = innodb;
*/
prontera,156,177,5	script	WoE Prize	100,{
setcastledata "prtg_cas01", 1, getcharid(2); // debug
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;
}
select "Kriemhild [Primary Castle]";
if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) {
	mes "Your guild failed to take this castle";
	close;
}
if ( $castle_claimed[1] ) {
	mes "Your guild already received the reward for this castle";
	close;
}
if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {
	mes "Ask your Guild Master to see me";
	close;
}
mes "receiving the reward for this castle";
query_sql "select claimed from castle_reward where guild_id = "+ getcharid(2), .@claimed;
if ( !.@claimed ) { // 1st time
	getitem 7960,200;
	getitem 12103,20;
	getitem 7959,20;
}
else if ( .@claimed == 1 ) { // 2nd time
	getitem 7960,250;
	getitem 12103,30;
	getitem 7959,30;
}
else { // 3rd time onwards
	getitem 7960,300;
	getitem 12103,40;
	getitem 7959,40;
}
set $castle_claimed[1], 1;
query_sql "insert into castle_reward values ( "+ getcharid(2) +", 1 ) on duplicate key update claimed = claimed +1";
close;
OnAgitEnd:
set $castle_claimed[1], 0; // everytime woe ends the variable resets
end;
OnInit:
waitingroom "Kriemhild Reward",0;
end;
}

Here we go a goddess!!! saved us o.o

damn i forgot to mention about this.....annie is this a same guild conquer? what i mean example "ABC" conquer today they will get 1st reward

after that same "ABC" guild defend their castle and obviously get the reward for the second time and then for the next woe the "ABC" guild defend their castle again but they failed to defend "DEF" guild conquer the kriemhild so this will be their 1st attempt on the castle so are they gonna get 1st reward and so for the next woe again "DEF" defend their castle but "ABC" defeated them and conquer kriemhild again are they rewards is going back to 1 or its going to continue into reward 3? cause if you going back they already have 2 counts for holding an castle.

Yep i just tested today and it continue what "ABC" have....it doesn't reset to 0 what i mean here is "ABC" have 2 counts already after getting back their castle their 2 counts added 1 counts so they proceed in reward 3 so i was thinking to reset their counts once their been defeated...

bump

bump

Edited by Mootie
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

hahaha xD

ok...

Sryx script ...

using $first, $second, $third variable

however, that is actually not the really correct way

because if let's say, the guild "ABC" conquer the castle, claimed the $first prize

guild "DEF" conquer the castle on 2nd week, will be able to claimed the $second prize without even go through 1st set of reward

and also, this part will definitely throw error

OnAgitEnd:
set $castle_claimed[1],
set $castle_claimed[2],
set $castle_claimed[3], 0; // everytime woe ends the variable resets

make sure every sentence is enclosed with ";" semi-colon symbol

mindstream script ...

script might be working, but doesn't work to the concept of topic starter

I believe what he is saying means

if guild "ABC" conquer the castle for on the 1st week, can get 1st set of reward

if guild "ABC" conquer that castle again on the 2nd week, then able to get 2nd set of the reward

your script there actually allow the guild "ABC" able to reward 3 sets of reward in 1st try lol

if I do this, I'll make use of SQL table instead of saving it with global permanent variable

because if using global permanent variable, need to do something like

setd "castle_claimed"+ getcharid(2), getd( "castle_claimed"+ getcharid(2) ) + 1;

if ( getd( "castle_claimed"+ getcharid(2) ) == 1 ) < claim 1st set of reward >

if ( getd( "castle_claimed"+ getcharid(2) ) == 2 ) < claim 2nd set of reward >

if ( getd( "castle_claimed"+ getcharid(2) ) >= 3 ) < claim 3rd set of reward >

which might actually able to build up quite a ton of variables in `mapreg` table

/*
create table castle_reward (
guild_id int(11) primary key,
claimed int(11)
); engine = innodb;
*/
prontera,156,177,5	script	WoE Prize	100,{
setcastledata "prtg_cas01", 1, getcharid(2); // debug
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;
}
select "Kriemhild [Primary Castle]";
if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) {
	mes "Your guild failed to take this castle";
	close;
}
if ( $castle_claimed[1] ) {
	mes "Your guild already received the reward for this castle";
	close;
}
if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {
	mes "Ask your Guild Master to see me";
	close;
}
mes "receiving the reward for this castle";
query_sql "select claimed from castle_reward where guild_id = "+ getcharid(2), .@claimed;
if ( !.@claimed ) { // 1st time
	getitem 7960,200;
	getitem 12103,20;
	getitem 7959,20;
}
else if ( .@claimed == 1 ) { // 2nd time
	getitem 7960,250;
	getitem 12103,30;
	getitem 7959,30;
}
else { // 3rd time onwards
	getitem 7960,300;
	getitem 12103,40;
	getitem 7959,40;
}
set $castle_claimed[1], 1;
query_sql "insert into castle_reward values ( "+ getcharid(2) +", 1 ) on duplicate key update claimed = claimed +1";
close;
OnAgitEnd:
set $castle_claimed[1], 0; // everytime woe ends the variable resets
end;
OnInit:
waitingroom "Kriemhild Reward",0;
end;
}

Ah OK so that's what was intended ... my bad /pat

damn i forgot to mention about this.....annie is this a same guild conquer? what i mean example "ABC" conquer today they will get 1st reward

after that same "ABC" guild defend their castle and obviously get the reward for the second time and then for the next woe the "ABC" guild defend their castle again but they failed to defend "DEF" guild conquer the kriemhild so this will be their 1st attempt on the castle so are they gonna get 1st reward and so for the next woe again "DEF" defend their castle but "ABC" defeated them and conquer kriemhild again are they rewards is going back to 1 or its going to continue into reward 3? cause if you going back they already have 2 counts for holding an castle.

Yep i just tested today and it continue what "ABC" have....it doesn't reset to 0 what i mean here is "ABC" have 2 counts already after getting back their castle their 2 counts added 1 counts so they proceed in reward 3 so i was thinking to reset their counts once their been defeated...

bump

bump

OK how about this instead of setting castle_claimed to 1=>

 set $castle_claimed[1], getcastledata( "prtg_cas01", 1); 

and



OnAgitEnd:
   if ($castle_claimed[1] && $castle_claimed[1] != getcastledata("prtg_cas01",1) ) {
query_sql "update castle_reward set claimed = 0 where guild_id = "+ $castle_claimed[1];
}
set $castle_claimed[1], 0; // everytime woe ends the variable resets
end;

Annie, Is there any specific reason to use array for castle_claimed?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

bump here

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  806
  • Reputation:   220
  • Joined:  03/13/12
  • Last Seen:  

OK i added the modifications i was talking about

I dunno if this is the best way to go about this perhaps an expert can provide an input :-)

/*
create table castle_reward (
guild_id int(11) primary key,
claimed int(11)
); engine = innodb;
*/
prontera,156,177,5    script    WoE Prize    100,{
   setcastledata "prtg_cas01", 1, getcharid(2); // debug
   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;
   }
   select "Kriemhild [Primary Castle]";
   if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) {
       mes "Your guild failed to take this castle";
       close;
   }
   if ( $castle_claimed[1] ) {
       mes "Your guild already received the reward for this castle";
       close;
   }
   if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {
       mes "Ask your Guild Master to see me";
       close;
   }
   mes "receiving the reward for this castle";
   query_sql "select claimed from castle_reward where guild_id = "+ getcharid(2), .@claimed;
   if ( !.@claimed ) { // 1st time
       getitem 7960,200;
       getitem 12103,20;
       getitem 7959,20;
   }
   else if ( .@claimed == 1 ) { // 2nd time
       getitem 7960,250;
       getitem 12103,30;
       getitem 7959,30;
   }
   else { // 3rd time onwards
       getitem 7960,300;
       getitem 12103,40;
       getitem 7959,40;
   }
   set $castle_claimed[1], getcharid(2);
   query_sql "insert into castle_reward values ( "+ getcharid(2) +", 1 ) on duplicate key update claimed = claimed +1";
   close;
OnAgitEnd:
   if ($castle_claimed[1] && $castle_claimed[1] != getcastledata("prtg_cas01",1) ) {
     // if there was a claim before then we need to reset incase different guild took castle this time.
     query_sql "update castle_reward set claimed = 0 where guild_id = "+ $castle_claimed[1];
   }
   set $castle_claimed[1], 0; // everytime woe ends the variable resets
   end;
OnInit:
   waitingroom "Kriemhild Reward",0;
   end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

Annie, Is there any specific reason to use array for castle_claimed?

yeah, this script was originated from here

at that time, woe:se was still under developing

in this case, there's no need for SQL table since there's only 1 guild ID is stored

prontera,156,177,5    script    WoE Prize    100,{
//    setcastledata "prtg_cas01", 1, getcharid(2); // debug
   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;
   }
   select "Kriemhild [Primary Castle]";
   if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) {
       mes "Your guild failed to take this castle";
       close;
   }
   if ( $castle_claimed[1] ) {
       mes "Your guild already received the reward for this castle";
       close;
   }
   if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {
       mes "Ask your Guild Master to see me";
       close;
   }
   mes "receiving the reward for this castle";
   if ( $castle_prtg1_gid != getcharid(2) ) {
       $castle_claimed_times[1] = 0;
       $castle_prtg1_gid = getcharid(2);
   }
   if ( !$castle_claimed_times[1] ) { // 1st time
       getitem 7960,200;
       getitem 12103,20;
       getitem 7959,20;
   }
   else if ( $castle_claimed_times[1] == 1 ) { // 2nd time
       getitem 7960,250;
       getitem 12103,30;
       getitem 7959,30;
   }
   else { // 3rd time onwards
       getitem 7960,300;
       getitem 12103,40;
       getitem 7959,40;
   }
   $castle_claimed[1] = 1;
   $castle_claimed_times[1]++;
   close;
OnAgitEnd:
   $castle_claimed[1] = 0; // everytime woe ends the variable resets
   end;
OnInit:
   waitingroom "Kriemhild Reward",0;
   end;
}

btw this topic feels like a request, so move over there

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  815
  • Reputation:   86
  • Joined:  10/26/12
  • Last Seen:  

Annie, Is there any specific reason to use array for castle_claimed?

yeah, this script was originated from here

at that time, woe:se was still under developing

in this case, there's no need for SQL table since there's only 1 guild ID is stored

prontera,156,177,5	script	WoE Prize	100,{
//	setcastledata "prtg_cas01", 1, getcharid(2); // debug
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;
}
select "Kriemhild [Primary Castle]";
if ( getcastledata( "prtg_cas01", 1) != getcharid(2) ) {
	mes "Your guild failed to take this castle";
	close;
}
if ( $castle_claimed[1] ) {
	mes "Your guild already received the reward for this castle";
	close;
}
if ( getguildmasterid( getcharid(2) ) != getcharid(0) ) {
	mes "Ask your Guild Master to see me";
	close;
}
mes "receiving the reward for this castle";
if ( $castle_prtg1_gid != getcharid(2) ) {
	$castle_claimed_times[1] = 0;
	$castle_prtg1_gid = getcharid(2);
}
if ( !$castle_claimed_times[1] ) { // 1st time
	getitem 7960,200;
	getitem 12103,20;
	getitem 7959,20;
}
else if ( $castle_claimed_times[1] == 1 ) { // 2nd time
	getitem 7960,250;
	getitem 12103,30;
	getitem 7959,30;
}
else { // 3rd time onwards
	getitem 7960,300;
	getitem 12103,40;
	getitem 7959,40;
}
$castle_claimed[1] = 1;
$castle_claimed_times[1]++;
close;
OnAgitEnd:
$castle_claimed[1] = 0; // everytime woe ends the variable resets
end;
OnInit:
waitingroom "Kriemhild Reward",0;
end;
}

btw this topic feels like a request, so move over there

oh my bad if its feel request please move it to there...so yeah back to the topic

annie,is this script will go for what i need? i mean

the "ABC" conquer 2 times will get 2nd time reward and for the 3rd time they have been defeated by "DEF" so the "DEF" is 1st conquer goes to 1st rewards...

and for the nxt woe "ABC" conquer again the kriemhild are they going to continue for 3rd attempt? or reset into 1 again?

this script is awesome o.o goes to what i really need it thx for this

Edited by Mootie
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...