zhakastia,92,56,4 script Guild Manager 81,{
set .item1, 714; // Item ID 1
set .item2, 677; // Item ID 2
set .itemreq1, 9; // Ammount of item number 1 (9 since an emp is also consumed naturally upon guild creation)
set .itemreq2, 10; // Ammount of item number 2
set .name$, "[^FF0000Guild Manager^000000]";
mes .name$;
mes "Hello there "+strcharinfo(0)+".";
mes "I can help you form a guild or disband your current one.";
menu "Sign-up for Guild Creation.",L_create,"Disband Guild.",L_disband,"Any requirements?",L_req,"No thanks.",L_cya;
L_create:
if(getpartyleader(getcharid(1)) == strcharinfo(0)) && (getcharid(2) == 0) { goto L_approve; }
else { goto L_inguild; end; }
L_approve:
next;
mes .name$;
mes "Alright, I need you to tell me the name you want for your guild.";
sleep2 1500;
input @gcreatenm$;
mes "Are you sure that's what you want?";
switch(select("Yes:No")) {
case1:
if(countitem(.item1) < .itemreq1) && (countitem(.item2) < .itemreq2) { goto L_nope; end; }
mes .name$;
mes "Alright then let's try this...";
atcommand "@guild "+@gcreatenm$;
next;
if(getcharid(2) == 0) { mes "Woops, seems like that guild already exists...try another name."; goto L_create; end; }
announce strcharinfo(0)+" has created "+strcharinfo(2)+" Guild!",0;
mes .name$;
mes "Congrats.";
delitem .item1, .itemreq1;
delitem .item2, .itemreq2;
close;
end;
case2:
goto L_create;
end;
}
L_disband:
if(getcharid(2) == 0) { goto L_noguild; end; }
if(getguildmaster(getcharid(2)) == strcharinfo(0)) { next; mes .name$; mes "Type this:"; mes "/breakguild ''"+strcharinfo(2)+"''"; close; end; }
else { mes .name$; mes "You're not the guild leader."; close; end; }
L_req:
next;
mes .name$;
mes "You'll need "+.itemreq1+" pieces of "+getitemname(.item1)+" and "+.itemreq2+" pieces of "+getitemname(.item2)+".";
close;
end;
L_nope:
next;
mes .name$;
mes "Bring me the items first!";
close;
L_inguild:
next;
mes .name$;
mes "You're either already in a guild or you're not the party leader!";
close;
L_noguild:
next;
mes .name$;
mes "You're not even in a guild!";
close;
L_cya:
next;
mes .name$;
mes "Next time then!";
close;
}
Not quite sure if it'd be possible to pull out the party member count but yea...