• 0
GenGen

Need help with my WOE reward script.

Question

quiz_02,304,263,6	script	WOE Reward	714,{
	mes "WOE";
	mes "You did a great job!";
    	mes "Here is your reward.";
    	getitem 13550,20;
	getitem 13989,50;
	getitem 14004,2;
	getitem 675,1;    //add your rewards here
	set woereward,0;
	next;
	warp "SavePoint",0,0;
    	end;

OnInit:
	waitingroom "WOE Reward",0;
	end;

}

-	script	woe_reward	-1,{
OnInit:
        set .map, "quiz_02";
        set .x, 304;
        set .y, 255;
	setarray .castles$[0],
		"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
		"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
		"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
		"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
		"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
		"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
        end;



OnMapLoadEvent:
	if ((agitcheck() && agitcheck2()) && (strcharinfo(3) == .castles$)){
	set woereward,1;
	end;
	}

OnAgitEnd:
        sleep 5000;    // wait 5 seconds after woe before warping the guild
	for (set [email protected],0; [email protected] < getarraysize(.castles$); set [email protected], [email protected]+1){
           	warpguild .map,.x,.y,getcastledata(.castles$[[email protected]],1);
		dispbottom "[ War of Emperium ] : Congrats! Your guild wins!";
		end;
        }
	if (getcastledata(.castles$[[email protected]],1) != getcharid(2) && woereward==1){
	dispbottom "[ War of Emperium ] : Its okay, you can try harder on next WoE!";
	getitem 607,1;
	set woereward,0;
	end;
	}
	


OnAgitEnd2:
	sleep 5000;    // wait 5 seconds after woe before warping the guild
	for (set [email protected],0; [email protected] < getarraysize(.castles$); set [email protected], [email protected]+1){
           	warpguild .map,.x,.y,getcastledata(.castles$[[email protected]],1);
		end;
        }
	if (getcastledata(.castles$[[email protected]],1) != getcharid(2) && woereward==1){
	dispbottom "[ War of Emperium ] : Its okay, you can try harder on next WoE!";
	getitem 607,1;
	set woereward,0;
	end;
	}
}

Hello Rathena!

Need help with my script. It wont recall winner nor give reward to participants.

This script should give reward to the winners, and also consolation prize to losers that participate in WoE.

But I'm getting error.

error.png.c837bb43c9df1f937e491cb6eb8561bf.png

Thanks in advance, Rathena!

woe1.txt

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

There're some errors.

set .map$, "quiz_02"; It should be a string variable. All the "unexpected"errors are because of that.

OnAgitEnd doesn't have a player attached, it just gets executed as WoE ends, so obviously dispbottom won't work.

quiz_02,304,263,6	script	WOE Reward	714,{
	mes "WOE";
	mes "You did a great job!";
    	mes "Here is your reward.";
    	getitem 13550,20;
	getitem 13989,50;
	getitem 14004,2;
	getitem 675,1;    //add your rewards here
	set woereward,0;
	next;
	warp "SavePoint",0,0;
    	end;

OnInit:
	waitingroom "WOE Reward",0;
	end;

}

-	script	woe_reward	-1,{
OnInit:
        set .map$, "quiz_02";
        set .x, 304;
        set .y, 255;
	setarray .castles$[0],
		"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
		"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
		"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
		"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
		"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
		"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
        end;



OnMapLoadEvent:
	if ((agitcheck() || agitcheck2()) && inarray(.castles$,strcharinfo(3))) {
		set woereward,1;
		end;
	}
	end;

OnAgitEnd2:

	set [email protected],20;

OnAgitEnd:
        set [email protected],(([email protected] == 0)? 19 : getarraysize(.castles$));
        sleep 5000;    // wait 5 seconds after woe before warping the guild
	for (;[email protected] < [email protected]; set [email protected], [email protected]+1){
		set [email protected],getcastledata(.castles$[[email protected]],CD_GUILD_ID);
		if([email protected]) {
			set [email protected],getguildmasterid([email protected]);
			set [email protected],inarray([email protected]_winners,[email protected]);
			if([email protected] == -1) {
				set [email protected]_winners[[email protected]++],[email protected];
           		warpguild .map$,.x,.y,[email protected];
				dispbottom "[ War of Emperium ] : Congrats! Your guild wins!",[email protected];
            }
		}
     }
	[email protected] = getunits(BL_PC,[email protected]);
	freeloop true;
	for(set [email protected],0; [email protected] < [email protected]; set [email protected], [email protected]+1){
		attachrid [email protected][[email protected]];
		[email protected] = getcharid(2);
		if([email protected]) {
			if(inarray([email protected]_winners,[email protected]) == -1 && woereward) {
				dispbottom "[ War of Emperium ] : Its okay, you can try harder on next WoE!";
				getitem 607,1;
				set woereward,0;
			}
		}
	}
	freeloop false;
	end;
}

 

Share this post


Link to post
Share on other sites
  • 0
On 12/8/2018 at 5:32 AM, n0tttt said:

There're some errors.

set .map$, "quiz_02"; It should be a string variable. All the "unexpected"errors are because of that.

OnAgitEnd doesn't have a player attached, it just gets executed as WoE ends, so obviously dispbottom won't work.

quiz_02,304,263,6	script	WOE Reward	714,{
	mes "WOE";
	mes "You did a great job!";
    	mes "Here is your reward.";
    	getitem 13550,20;
	getitem 13989,50;
	getitem 14004,2;
	getitem 675,1;    //add your rewards here
	set woereward,0;
	next;
	warp "SavePoint",0,0;
    	end;

OnInit:
	waitingroom "WOE Reward",0;
	end;

}

-	script	woe_reward	-1,{
OnInit:
        set .map$, "quiz_02";
        set .x, 304;
        set .y, 255;
	setarray .castles$[0],
		"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05",
		"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05",
		"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05",
		"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05",
		"arug_cas01","arug_cas02","arug_cas03","arug_cas04","arug_cas05",
		"schg_cas01","schg_cas02","schg_cas03","schg_cas04","schg_cas05";
        end;



OnMapLoadEvent:
	if ((agitcheck() || agitcheck2()) && inarray(.castles$,strcharinfo(3))) {
		set woereward,1;
		end;
	}
	end;

OnAgitEnd2:

	set [email protected],20;

OnAgitEnd:
        set [email protected],(([email protected] == 0)? 19 : getarraysize(.castles$));
        sleep 5000;    // wait 5 seconds after woe before warping the guild
	for (;[email protected] < [email protected]; set [email protected], [email protected]+1){
		set [email protected],getcastledata(.castles$[[email protected]],CD_GUILD_ID);
		if([email protected]) {
			set [email protected],getguildmasterid([email protected]);
			set [email protected],inarray([email protected]_winners,[email protected]);
			if([email protected] == -1) {
				set [email protected]_winners[[email protected]++],[email protected];
           		warpguild .map$,.x,.y,[email protected];
				dispbottom "[ War of Emperium ] : Congrats! Your guild wins!",[email protected];
            }
		}
     }
	[email protected] = getunits(BL_PC,[email protected]);
	freeloop true;
	for(set [email protected],0; [email protected] < [email protected]; set [email protected], [email protected]+1){
		attachrid [email protected][[email protected]];
		[email protected] = getcharid(2);
		if([email protected]) {
			if(inarray([email protected]_winners,[email protected]) == -1 && woereward) {
				dispbottom "[ War of Emperium ] : Its okay, you can try harder on next WoE!";
				getitem 607,1;
				set woereward,0;
			}
		}
	}
	freeloop false;
	end;
}

 

Untitled.png.3b12c1f027d7e95195859be538d72cc4.png

Ah I see, thanks for the explanation, however I get this error while trying the your script.

Share this post


Link to post
Share on other sites
  • 0

You need to update your rAthena. That's a fairly

Share this post


Link to post
Share on other sites
  • 0

Alright.

I'll try. Currently I'm using offline rathena by anacondaqq

Will be back if I have issues.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now