Jump to content

Question

Posted (edited)

So the script function is to give the gift of each end of WoE to the owner of a certain castle & gifts directly given to all players in a guild that won the WoE, so I want to give gifts Item ID: 7539 & Cashpoint +10 every time WoE ends.

only an online player who get the prize.

if anyone can make a simple script?

thanks.

Edited by Yasunari Ishibashi
  • Answers 64
  • Created
  • Last Reply

Top Posters For This Question

Recommended Posts

Posted (edited)

Hi! Here's a script from Goddameit which i have edited...

//Author : Goddameit
//Version : 2011/12/16 - 01:04
function script AllGuildMemberEvent {
if(!set(.@gid,getcastledata(getarg(0),1)))
 return;
query_sql("select account_id, char_id from `guild_member` where guild_id = '"+.@gid+"'", .@gmaid, .@gmcid);
for(set .@i,0;.@i
{
 if(isloggedin(.@gmaid[.@i]))
 getitem 12628,1,.@gmaid[.@i];
 }
}
- script AGME -1,{
OnAGME:
setarray .@maps$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05";
setarray .@maps$[5],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05";
setarray .@maps$[10],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05";
setarray .@maps$[15],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05";
for( set .@i,0; .@i <= 19; set .@i, .@i+1)
{
 callfunc "AllGuildMemberEvent",.@maps$[.@i],0,
  "System","WoE Victory Reward","Congratulations! Your guild succeeded in   occupying "+ getcastlename(.@maps$[.@i]) +". This is your rewards.",
  501,1,1,0,
  "[You got a mail!! Please relogin to reupdate your mail list.]";
}
end;
}

For the cashpoints, just make an item that gives a cash point and add it's getitem command..

EDIT: I forgot to tell you to add onAgitEnd of your woe script..

donpcevent "AGME::OnAGME";

Hope it helps..

Edited by wakoko321
Posted (edited)

What if I use the Toasty WoE?

where I should put donpcevent "AGME:: OnAGME";?

 if (isloggedin (. @ gmaid [. @ i]))
getitem 12628.1,. @ gmaid [. @ i];
CASHPOINTS set #, # CASHPOINTS + 10 

is it like that?

Edited by Yasunari Ishibashi
Posted

:( ???

if (isloggedin (. @ gmaid [. @ i]))

getitem 12628.1,. @ gmaid [. @ i];

CASHPOINTS set #, # CASHPOINTS + 10

that is wrong....

should be like this

if( isloggedin (.@gmaid[.@i])){
getitem 12628.1,.@gmaid[.@i];
set #CASHPOINTS,#CASHPOINTS + 10;
}

Posted

sorry for the late reply..

I'm using Toasty's Woe Controller too..

find the line

announce "The War Of Emperium is over!",bc_all;

donpcevent strnpcinfo(3)+"::OnDisplayOwners";

add it after that...

Posted

//Author : Goddameit

//Version : 2011/12/16 - 01:04

function script AllGuildMemberEvent {

if(!set(.@gid,getcastledata(getarg(0),1)))

return;

query_sql("select account_id, char_id from `guild_member` where guild_id = '"+.@gid+"'", .@gmaid, .@gmcid);

for(set .@i,0;.@i -> something is missing? please justification script.

{

Posted
function script AllGuildMemberEvent {

if(!set(.@gid,getcastledata(getarg(0),1)))

return;

query_sql("select account_id, char_id from `guild_member` where guild_id = '"+.@gid+"'", .@gmaid, .@gmcid);

for(set .@i,0;.@i<getarraysize(.@gmcid);set .@i,.@i+1)

{

if( isloggedin (.@gmaid[.@i])){

getitem 607.10,.@gmaid[.@i];

set #CASHPOINTS,#CASHPOINTS+10;

}

- script AGME -1,{

OnAGME:

setarray .@maps$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05";

setarray .@maps$[5],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05";

setarray .@maps$[10],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05";

setarray .@maps$[15],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05";

for( set .@i,0; .@i <= 19; set .@i, .@i+1)

{

callfunc "AllGuildMemberEvent",.@maps$[.@i],1,

"System","WoE Victory Reward","Congratulations! Your guild succeeded in occupying "+ getcastlename(.@maps$[.@i]) +". This is your rewards.",

501,1,1,0,

"[You got a mail!! Please relogin to reupdate your mail list.]";

}

end;

}

script does not work properly, please justification, thanks

Posted

You're missing 2 right curlys.. LOL

//Author : Goddameit
//Version : 2011/12/16 - 01:04
function script AllGuildMemberEvent {
if(!set(.@gid,getcastledata(getarg(0),1)))
 return;
query_sql("select account_id, char_id from `guild_member` where guild_id = '"+.@gid+"'", .@gmaid, .@gmcid);
for(set .@i,0;.@i<getarraysize(.@gmcid);set .@i,.@i+1)
{
 if(isloggedin(.@gmaid[.@i]))
 getitem 12628,1,.@gmaid[.@i];
 }
}
- script AGME -1,{
OnAGME:
setarray .@maps$[0],"aldeg_cas01","aldeg_cas02","aldeg_cas03","aldeg_cas04","aldeg_cas05";
setarray .@maps$[5],"gefg_cas01","gefg_cas02","gefg_cas03","gefg_cas04","gefg_cas05";
setarray .@maps$[10],"payg_cas01","payg_cas02","payg_cas03","payg_cas04","payg_cas05";
setarray .@maps$[15],"prtg_cas01","prtg_cas02","prtg_cas03","prtg_cas04","prtg_cas05";
for( set .@i,0; .@i <= 19; set .@i, .@i+1)
{
 callfunc "AllGuildMemberEvent",.@maps$[.@i],0,
  "System","WoE Victory Reward","Congratulations! Your guild succeeded in   occupying "+ getcastlename(.@maps$[.@i]) +". This is your rewards.",
  501,1,1,0,
  "[You got a mail!! Please relogin to reupdate your mail list.]";
}
end;
}

Posted

You missed 1 curly,

{

for(set .@i,0;.@i<getarraysize(.@gmcid);set .@i,.@i+1)

if( isloggedin (.@gmaid[.@i])){

getitem 607.10,.@gmaid[.@i];

set #CASHPOINTS,#CASHPOINTS+10;

}

Should be

for(set .@i,0;.@i<getarraysize(.@gmcid);set .@i,.@i+1)

{

if(isloggedin(.@gmaid[.@i]))

getitem 12628,1,.@gmaid[.@i];

}

}//-missing curly

Posted

Sir wakoko321 thank you but Can you post it in pastebin? how to put in Toasty's Woe Controller and fine the line

announce "The War Of Emperium is over!",bc_all;

donpcevent strnpcinfo(3)+"::OnDisplayOwners";

Thanks.

Posted (edited)

I tested the script but it gives me 22 times of the said prize..

Ex.

you got Yggdrasil Seed(1).

you got Yggdrasil Seed(1).

you got Yggdrasil Seed(1).

So i will recieve 22 ygg seed after woe?weird...

Need Help..

There is no error in the map server..

Thanks in advance

Edited by Lanz

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...