somebody can help to change this script to use unique_id
This is the part for config how to setting reward options
// -----------------------------------------------------------
// Reward options.
// -----------------------------------------------------------
// [1] Enable rewards.
// [2] Mail all rewards.
// - If not set, players receive items in their inventory.
// - Only ONE item can be sent via mail, plus Zeny.
// - Note that offline players do NOT receive rewards.
// [4] Only reward Guild Masters.
// - If not set, all guild members are rewarded.
// - If mailing is enabled (option 2), offline Guild Masters WILL receive rewards.
// [8] Duplicate IP check.
// - Members in a guild with the same IP address are not rewarded.
// - If Guild Masters is enabled (option 4), this feature is not used.
// -----------------------------------------------------------
// Combine values as needed (e.g. 1|8 = 1+8 = 9).
set .Options, 1|8;
// Rewards per castle.
// -- when given directly: <itemID>,<amount>{,<itemID>,<amount>,...}
// -- via mail (option 2): <itemID>,<amount>,<Zeny>
setarray .Reward[0],31509,1,12103,1,16770,1,6380,15,31510,1;
This is the part for give the reward :
OnReward:
set .@sql$, ((.Options&4)?"position = 0":"online = 1");
if (.Options&2) set .@str$,gettimestr("%B %d, %Y",21);
freeloop(1);
for(set .@i,0; .@i<30; set .@i,.@i+1)
if (getarg(0)&(1<<.@i)) {
set .@gid, getcastledata(.Castles$[.@i],1);
if (!.@gid) continue;
set .@size, query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@gid+"' AND "+.@sql$,.@aid,.@cid);
for(set .@j,0; .@j<.@size; set .@j,.@j+1) {
if ((.Options&8) && !(.Options&4)) {
set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a");
if (getd(".@ip_"+.@i+"_"+.@ip$)) continue;
setd ".@ip_"+.@i+"_"+.@ip$,1;
}
if (.Options&2) {
query_sql("INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) VALUES ("+
"'no-reply',"+.@cid[.@j]+",'** Siege Reward: "+getcastlename(.Castles$[.@i])+" **',"+
"'Brave one,% % Congratulations!% Your guild has successfully occupied% territory in the War of Emperium on% "+.@str$+".% % % % % [ Your reward is attached. ]',"+
.Reward[0]+","+.Reward[1]+",0,"+.Reward[2]+",UNIX_TIMESTAMP(NOW()))");
if (!getd(".@str_"+.@cid[.@j]) && isloggedin(.@aid[.@j],.@cid[.@j])) {
setd ".@str_"+.@cid[.@j],1;
message rid2name(.@aid[.@j]),"You've got mail! Please re-login to update your mailing list.";
}
} else if (isloggedin(.@aid[.@j])) {
for(set .@k,0; .@k<getarraysize(.Reward); set .@k,.@k+2)
getitem .Reward[.@k], .Reward[.@k+1], .@aid[.@j];
message rid2name(.@aid[.@j]),"You have been rewarded for conquering "+getcastlename(.Castles$[.@i])+".";
}
}
}
if (.Options&2) query_sql("UPDATE `mail` SET message = REPLACE(message,'%',CHAR(13)) WHERE send_name = 'no-reply'");
return;
Question
LearningRO
somebody can help to change this script to use unique_id
This is the part for config how to setting reward options
This is the part for give the reward :
OnReward: set .@sql$, ((.Options&4)?"position = 0":"online = 1"); if (.Options&2) set .@str$,gettimestr("%B %d, %Y",21); freeloop(1); for(set .@i,0; .@i<30; set .@i,.@i+1) if (getarg(0)&(1<<.@i)) { set .@gid, getcastledata(.Castles$[.@i],1); if (!.@gid) continue; set .@size, query_sql("SELECT account_id,char_id FROM `guild_member` WHERE guild_id = '"+.@gid+"' AND "+.@sql$,.@aid,.@cid); for(set .@j,0; .@j<.@size; set .@j,.@j+1) { if ((.Options&8) && !(.Options&4)) { set .@ip$, replacestr(getcharip(.@aid[.@j]),".","a"); if (getd(".@ip_"+.@i+"_"+.@ip$)) continue; setd ".@ip_"+.@i+"_"+.@ip$,1; } if (.Options&2) { query_sql("INSERT INTO `mail` (send_name,dest_id,title,message,nameid,amount,identify,zeny,time) VALUES ("+ "'no-reply',"+.@cid[.@j]+",'** Siege Reward: "+getcastlename(.Castles$[.@i])+" **',"+ "'Brave one,% % Congratulations!% Your guild has successfully occupied% territory in the War of Emperium on% "+.@str$+".% % % % % [ Your reward is attached. ]',"+ .Reward[0]+","+.Reward[1]+",0,"+.Reward[2]+",UNIX_TIMESTAMP(NOW()))"); if (!getd(".@str_"+.@cid[.@j]) && isloggedin(.@aid[.@j],.@cid[.@j])) { setd ".@str_"+.@cid[.@j],1; message rid2name(.@aid[.@j]),"You've got mail! Please re-login to update your mailing list."; } } else if (isloggedin(.@aid[.@j])) { for(set .@k,0; .@k<getarraysize(.Reward); set .@k,.@k+2) getitem .Reward[.@k], .Reward[.@k+1], .@aid[.@j]; message rid2name(.@aid[.@j]),"You have been rewarded for conquering "+getcastlename(.Castles$[.@i])+"."; } } } if (.Options&2) query_sql("UPDATE `mail` SET message = REPLACE(message,'%',CHAR(13)) WHERE send_name = 'no-reply'"); return;
this script form woe_controller.txt
Edited by melv0thanks
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.