well the sample is working, but if add this into my koe script, and my castle is empty, the npc always says: This NPC is reserved for Guild null and its allies.
i also added my map there: set .@GuildID,getcastledata("guild_vs1",1);
edit: nvm got it:
// KoE Entrance
prontera,156,182,4 script King of Emperium#KoE 108,{
set .@GuildID,getcastledata("guild_vs1",1);
mes "[The King]";
if ( getcharid(2) == 0 ) { // [b]if the player has no guild[/b]
mes "you have no guild!.";
close;
}
if (getcharid(2) == GetCastleData("guild_vs1",1)) { // <- [b]if my guild got the caslte warp me to:[/b]
mes "Hey "+strcharinfo(0)+"";
mes "would you go back into the";
mes "^FF0000King of Emperium Castle?^000000";
if ( select ( "Yes!", "No!" ) == 2 ) close;
switch( rand(1,4) ){
case 1: warp "guild_vs1", 27, 50; end;
case 2: warp "guild_vs1", 49, 71; end;
case 3: warp "guild_vs1", 72, 50; end;
case 4: warp "guild_vs1", 49, 28; end;
}
}
query_sql( "SELECT `alliance_id` FROM `guild_alliance` WHERE `guild_id` = "+.@GuildID+"",.@Allie );
if( getcharid(2) == .@GuildID ) set .@Allowed,1;
for( set .@i,0; .@i < getarraysize( .@Allie ); set .@i,.@i + 1 )
if( getcharid(2) == .@Allie[.@i] ) set .@Allowed,1;
if( !.@Allowed ){
mes "Hello.";
mes "Would you enter the event?"; // <-[b] if there is no ally, warp me to:[/b]
if ( select ( "Ja!", "Nein.." ) == 2 ) close;
switch( rand(1,4) ){
case 1: warp "guild_vs1", 50, 88; end;
case 2: warp "guild_vs1", 88, 50; end;
case 3: warp "guild_vs1", 50, 11; end;
case 4: warp "guild_vs1", 11, 50; end;
}
}else{
mes "Hey "+strcharinfo(0)+"";
mes "would you enter into the";
mes "^FF0000King of Emperium Castle?^000000"; // [b]if the guild are allys, warp me to:[/b]
if ( select ( "Yes!", "No!" ) == 2 ) close;
switch( rand(1,4) ){
case 1: warp "guild_vs1", 27, 50; end;
case 2: warp "guild_vs1", 49, 71; end;
case 3: warp "guild_vs1", 72, 50; end;
case 4: warp "guild_vs1", 49, 28; end;
}
}
close;
mes "Hello.";
mes "would you enter the ^FF0000King of Emperium Event^000000?"; //[b] <- do i need this?[/b]
if ( select ( "Yes!", "No.." ) == 2 ) close;
switch( rand(1,4) ){
case 1: warp "guild_vs1", 50, 88; end;
case 2: warp "guild_vs1", 88, 50; end;
case 3: warp "guild_vs1", 50, 11; end;
case 4: warp "guild_vs1", 11, 50; end;
}
}
another question, if the event endet the players can still warp into the room if they dont close the dialog, would it possible to add some koe check ? :
mes "would you enter the ^FF0000King of Emperium Event^000000?"; // <- do i need this?
if ( select ( "Yes!", "No.." ) == 2 ) close;
[b]if koe == end > close: <- something like this?[/b]
switch( rand(1,4) ){
case 1: warp "guild_vs1", 50, 88; end;
case 2: warp "guild_vs1", 88, 50; end;
case 3: warp "guild_vs1", 50, 11; end;
case 4: warp "guild_vs1", 11, 50; end;