Jump to content
  • 0

Need help with my WOE reward script.


GenGen

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  11/22/11
  • Last Seen:  

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 .@i,0; .@i < getarraysize(.castles$); set .@i, .@i+1){
           	warpguild .map,.x,.y,getcastledata(.castles$[.@i],1);
		dispbottom "[ War of Emperium ] : Congrats! Your guild wins!";
		end;
        }
	if (getcastledata(.castles$[.@i],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 .@i,0; .@i < getarraysize(.castles$); set .@i, .@i+1){
           	warpguild .map,.x,.y,getcastledata(.castles$[.@i],1);
		end;
        }
	if (getcastledata(.castles$[.@i],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

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

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 .@i,20;

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

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  11/22/11
  • Last Seen:  

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 .@i,20;

OnAgitEnd:
        set .@size,((.@i == 0)? 19 : getarraysize(.castles$));
        sleep 5000;    // wait 5 seconds after woe before warping the guild
	for (;.@i < .@size; set .@i, .@i+1){
		set .@guild,getcastledata(.castles$[.@i],CD_GUILD_ID);
		if(.@guild) {
			set .@gm,getguildmasterid(.@guild);
			set .@j,inarray(.@guild_winners,.@guild);
			if(.@j == -1) {
				set .@guild_winners[.@k++],.@guild;
           		warpguild .map$,.x,.y,.@guild;
				dispbottom "[ War of Emperium ] : Congrats! Your guild wins!",.@gm;
            }
		}
     }
	.@n = getunits(BL_PC,.@player);
	freeloop true;
	for(set .@i,0; .@i < .@n; set .@i, .@i+1){
		attachrid .@player[.@i];
		.@guild = getcharid(2);
		if(.@guild) {
			if(inarray(.@guild_winners,.@guild) == -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.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

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

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  11/22/11
  • Last Seen:  

Alright.

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

Will be back if I have issues.

 

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