Jump to content
  • 0
ρixєℓ

Help in NPC CTE.

Question

Hello, I need a help with this npc, how can I let the team 1 team not attack 2? I've tried all ways but it still fails.

 

 

//Author Goddameit

//Version 2012/06/09 - ''flag_event'' map
guild_room,236,283,4 script CTF Premiador 100,{
 
if($ctfevt == 0){ dispbottom "[CTF] Desculpe mais não tenho nara para você."; warp "SavePoint",0,0; end; }
 
query_sql "UPDATE `login` SET `ppoints` = `ppoints` +20 WHERE `account_id`='"+getcharid(3)+"'";
dispbottom "[CTF] Você acaba de ganhar 20 Peace Points";
warp "SavePoint",0,0;
end;
}
prontera,150,185,4 script CTF -1,{
 
OnInit:
bindatcmd ("CTF", "CTF::OnAtcmd_CTF");
set $ctfevt,0;
end;
 
OnClock0900: callsub EventoCTF;
OnClock1300: callsub EventoCTF;
OnClock1700: callsub EventoCTF;
OnClock0000: callsub EventoCTF;
 
 
EventoCTF:
announce "[CTF] A captura pela bandeira vai começar em 5 minutos, digite @ctf para se registrar.",8;
set $ctfevt,1;
initnpctimer;
end;
OnAtcmd_CTF:
if($ctfevt == 0){ dispbottom "[CTF] A captura pela bandeira não começou"; end; }
function c_flagon {
while(set(.@i,.@i+1)<=6)
{
if(getd("$@flag"+.@i+"_a")==getarg(0))
return .@i;
}
return 0;
}
dispbottom "[CTF] Você acaba de se registrar, espere até ser chamado.";
set @ctf_tid,.join==0?1:.join==1?2:.join%2;
setd ".join_j"+.join,getcharid(3);
set .join,.join+1;
close;
 
OnTimer600000:
set .w,0;
if(.ctf_tp1!=.ctf_tp2)
{
announce "[CTF] O Time "+set(.w,(.ctf_tp1>.ctf_tp2?1:2))+" capturou mais bandeiras e venceu.",0;
for(set .@io,0;.@io<=.join;set .@io,.@io+1)
{
if(attachrid(getd(".join_j"+.@io)))
{
getmapxy(@cm$,@cx,@cy,0);
if(@cm$=="flag_event")
{
if(.w==@ctf_tid)
{
warp "guild_room",236,283;
}else
warp "prontera",150,180;
}
setd ".join_j"+.@io,0;
deltimer "FlagTimer::OnTimerStart";
}
}
set .join,0;
}
mapwarp "flag_event","prontera",150,180;
mapannounce "flag_event","[CTF] Fim de jogo.",0;
end;
OnTimer1:
OnStart:
set .game,1;
set .join,0;
set .ctf_tn1,0;
set .ctf_tn2,0;
set .ctf_tp1,0;
set .ctf_tp2,0;
sleep2 300000;
set .game,2;
set $ctfevt,0;
setmapflag "flag_event",mf_pvp;
setmapflag "flag_event",mf_pvp_noguild;
removemapflag "flag_event",mf_gvg;
announce "[CTF] A captura pela bandeira começou.",0;
for(set .@io,0;.@io<=.join;set .@io,.@io+1)
{
if(attachrid(getd(".join_j"+.@io)))
{
if(@ctf_tid==2)
warp "flag_event",180,87;
else
warp "flag_event",33,93;
}
}
initnpctimer "CTF-Point#1";
initnpctimer "CTF-Point#2";
end;
OnPCDieEvent:
getmapxy(@cm$,@cx,@cy,0);
if(@cm$!="flag_event"||.game!=2) // ||!@ctf_tid
end;
addtimer 5000,"CTF-Point#"+@ctf_tid+"::OnDie";
OnPCEnd:
OnPCLogoutEvent:
set @ctf_tu,0;
set @CTF,0;
if(set(.@i,c_flagon(getcharid(0))))
{
deltimer "FlagTimer::OnTimerStart";
callfunc "CTF_LimitSkillWhenCareFlag",0;
getmapxy(.@cm$,.@cx,.@cy,0);
hideoffnpc "Flag#"+.@i;
stopnpctimer "Flag#"+.@i;
setd "$@flag"+.@i+"_a",0;
movenpc "Flag#"+.@i,.@cx,.@cy;
if(@ctf_xt&&@ctf_tid)
{
specialeffect2 666;
set @ctf_xt,0;
mapannounce "flag_event","[CTF] Time "+@ctf_tid+" +1 Ponto.",0;
setd ".ctf_tp"+@ctf_tid,getd(".ctf_tp"+@ctf_tid)+1;
mapannounce "flag_event","[CTF] Time 1 ["+.ctf_tp1+"] Pontos : Time 2 ["+.ctf_tp2+"] Pontos",0;
movenpc "Flag#"+.@i,107,90;
getmapxy(getvariableofnpc(.cm$,"Flag#"+.@i),getvariableofnpc(.cx,"Flag#"+.@i),getvariableofnpc(.cy,"Flag#"+.@i),1,"Flag#"+.@i);
}
end;
}
set @ctf_xt,0;
end;
}
flag_event,107,90,4 script Flag#1 722,{
if(getvariableofnpc(.game,"CTF")!=2) // ||!@ctf_tid
end;
function flag_tid {
if(getarg(0)<4)
return 1;
else
return 2;
}
set .k,atoi(strnpcinfo(2));
getmapxy(.cm$,.cx,.cy,1);
getmapxy(.@cm$,.@cx,.@cy,0);
if(pow(.cx-.@cx,2)>9||pow(.cy-.@cy,2)>9)
{
message strcharinfo(0),"Chegue mais perto oras.."+rand(1000)+""+rand(1000);
end;
}
if(@CTF)
end;
set @CTF,1;
setd "$@flag"+.k+"_a",getcharid(0);
hideonnpc strnpcinfo(0);
callfunc "CTF_LimitSkillWhenCareFlag",1;
addtimer 500,"FlagTimer::OnTimerStart";
end;
}
- script FlagTimer -,{
 
OnTimerStart:
set @ctf_tu,@ctf_tu+1;
if(@ctf_tu>120)
{
unitskilluseid getcharid(3),173,1;
doevent "CTF::OnPCEnd";
end;
}
specialeffect2 589;
addtimer 500,"FlagTimer::OnTimerStart";
end;
}
 
flag_event,33,93,4 script CTF-Point#1 111,3,3,{
end;
 
OnDie:
if(@ctf_tid==2)
warp "flag_event",180,87;
else
warp "flag_event",33,93;
end;
OnTouch:
if(getvariableofnpc(.game,"CTF")!=2||!@ctf_tid)
end;
if(@ctf_tid!=atoi(strnpcinfo(2)))
end;
set @ctf_xt,1;
doevent "CTF::OnPCEnd";
end;
 
OnTimer500:
specialeffect 225;
sleep(500);
specialeffect 236;
sleep(500);
specialeffect 237;
sleep(500);
specialeffect 238;
initnpctimer;
end;
}
flag_event,180,87,4 duplicate(CTF-Point#1) CTF-Point#2 45,3,3
flag_event mapflag nowarpto
flag_event mapflag nosave
flag_event mapflag nobranch
flag_event mapflag nopenalty
flag_event mapflag noreturn
flag_event mapflag nowarp
flag_event mapflag noicewall
flag_event mapflag nomemo
flag_event mapflag pvp
guild_room mapflag nowarpto
guild_room mapflag nosave
guild_room mapflag nobranch
guild_room mapflag noreturn
guild_room mapflag nowarp
guild_room mapflag nomemo

 
Edited by ρixєℓ

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hello, I need a help with this npc, how can I let the team 1 team not attack 2? I've tried all ways but it still fails.

 

 

//Author Goddameit

//Version 2012/06/09 - ''flag_event'' map

//Web http://bit.ly/Ja4udH

guild_room,236,283,4 script CTF Premiador 100,{

 

if($ctfevt == 0){ dispbottom "[CTF] Desculpe mais não tenho nara para você."; warp "SavePoint",0,0; end; }

 

query_sql "UPDATE `login` SET `ppoints` = `ppoints` +20 WHERE `account_id`='"+getcharid(3)+"'";

dispbottom "[CTF] Você acaba de ganhar 20 Peace Points";

warp "SavePoint",0,0;

end;

}

prontera,150,185,4 script CTF -1,{

 

OnInit:

bindatcmd ("CTF", "CTF::OnAtcmd_CTF");

set $ctfevt,0;

end;

 

OnClock0900: callsub EventoCTF;

OnClock1300: callsub EventoCTF;

OnClock1700: callsub EventoCTF;

OnClock0000: callsub EventoCTF;

 

 

EventoCTF:

announce "[CTF] A captura pela bandeira vai começar em 5 minutos, digite @ctf para se registrar.",8;

set $ctfevt,1;

initnpctimer;

end;

OnAtcmd_CTF:

if($ctfevt == 0){ dispbottom "[CTF] A captura pela bandeira não começou"; end; }

function c_flagon {

while(set(.@i,.@i+1)<=6)

{

if(getd("$@flag"+.@i+"_a")==getarg(0))

return .@i;

}

return 0;

}

dispbottom "[CTF] Você acaba de se registrar, espere até ser chamado.";

set @ctf_tid,.join==0?1:.join==1?2:.join%2;

setd ".join_j"+.join,getcharid(3);

set .join,.join+1;

close;

 

OnTimer600000:

set .w,0;

if(.ctf_tp1!=.ctf_tp2)

{

announce "[CTF] O Time "+set(.w,(.ctf_tp1>.ctf_tp2?1:2))+" capturou mais bandeiras e venceu.",0;

for(set .@io,0;.@io<=.join;set .@io,.@io+1)

{

if(attachrid(getd(".join_j"+.@io)))

{

getmapxy(@cm$,@cx,@cy,0);

if(@cm$=="flag_event")

{

if(.w==@ctf_tid)

{

warp "guild_room",236,283;

}else

warp "prontera",150,180;

}

setd ".join_j"+.@io,0;

deltimer "FlagTimer::OnTimerStart";

}

}

set .join,0;

}

mapwarp "flag_event","prontera",150,180;

mapannounce "flag_event","[CTF] Fim de jogo.",0;

end;

OnTimer1:

OnStart:

set .game,1;

set .join,0;

set .ctf_tn1,0;

set .ctf_tn2,0;

set .ctf_tp1,0;

set .ctf_tp2,0;

sleep2 300000;

set .game,2;

set $ctfevt,0;

setmapflag "flag_event",mf_pvp;

setmapflag "flag_event",mf_pvp_noguild;

removemapflag "flag_event",mf_gvg;

announce "[CTF] A captura pela bandeira começou.",0;

for(set .@io,0;.@io<=.join;set .@io,.@io+1)

{

if(attachrid(getd(".join_j"+.@io)))

{

if(@ctf_tid==2)

warp "flag_event",180,87;

else

warp "flag_event",33,93;

}

}

initnpctimer "CTF-Point#1";

initnpctimer "CTF-Point#2";

end;

OnPCDieEvent:

getmapxy(@cm$,@cx,@cy,0);

if(@cm$!="flag_event"||.game!=2) // ||!@ctf_tid

end;

addtimer 5000,"CTF-Point#"+@ctf_tid+"::OnDie";

OnPCEnd:

OnPCLogoutEvent:

set @ctf_tu,0;

set @CTF,0;

if(set(.@i,c_flagon(getcharid(0))))

{

deltimer "FlagTimer::OnTimerStart";

callfunc "CTF_LimitSkillWhenCareFlag",0;

getmapxy(.@cm$,.@cx,.@cy,0);

hideoffnpc "Flag#"+.@i;

stopnpctimer "Flag#"+.@i;

setd "$@flag"+.@i+"_a",0;

movenpc "Flag#"+.@i,.@cx,.@cy;

if(@ctf_xt&&@ctf_tid)

{

specialeffect2 666;

set @ctf_xt,0;

mapannounce "flag_event","[CTF] Time "+@ctf_tid+" +1 Ponto.",0;

setd ".ctf_tp"+@ctf_tid,getd(".ctf_tp"+@ctf_tid)+1;

mapannounce "flag_event","[CTF] Time 1 ["+.ctf_tp1+"] Pontos : Time 2 ["+.ctf_tp2+"] Pontos",0;

movenpc "Flag#"+.@i,107,90;

getmapxy(getvariableofnpc(.cm$,"Flag#"+.@i),getvariableofnpc(.cx,"Flag#"+.@i),getvariableofnpc(.cy,"Flag#"+.@i),1,"Flag#"+.@i);

}

end;

}

set @ctf_xt,0;

end;

}

flag_event,107,90,4 script Flag#1 722,{

if(getvariableofnpc(.game,"CTF")!=2) // ||!@ctf_tid

end;

function flag_tid {

if(getarg(0)<4)

return 1;

else

return 2;

}

set .k,atoi(strnpcinfo(2));

getmapxy(.cm$,.cx,.cy,1);

getmapxy(.@cm$,.@cx,.@cy,0);

if(pow(.cx-.@cx,2)>9||pow(.cy-.@cy,2)>9)

{

message strcharinfo(0),"Chegue mais perto oras.."+rand(1000)+""+rand(1000);

end;

}

if(@CTF)

end;

set @CTF,1;

setd "$@flag"+.k+"_a",getcharid(0);

hideonnpc strnpcinfo(0);

callfunc "CTF_LimitSkillWhenCareFlag",1;

addtimer 500,"FlagTimer::OnTimerStart";

end;

}

- script FlagTimer -,{

 

OnTimerStart:

set @ctf_tu,@ctf_tu+1;

if(@ctf_tu>120)

{

unitskilluseid getcharid(3),173,1;

doevent "CTF::OnPCEnd";

end;

}

specialeffect2 589;

addtimer 500,"FlagTimer::OnTimerStart";

end;

}

 

flag_event,33,93,4 script CTF-Point#1 111,3,3,{

end;

 

OnDie:

if(@ctf_tid==2)

warp "flag_event",180,87;

else

warp "flag_event",33,93;

end;

OnTouch:

if(getvariableofnpc(.game,"CTF")!=2||!@ctf_tid)

end;

if(@ctf_tid!=atoi(strnpcinfo(2)))

end;

set @ctf_xt,1;

doevent "CTF::OnPCEnd";

end;

 

OnTimer500:

specialeffect 225;

sleep(500);

specialeffect 236;

sleep(500);

specialeffect 237;

sleep(500);

specialeffect 238;

initnpctimer;

end;

}

flag_event,180,87,4 duplicate(CTF-Point#1) CTF-Point#2 45,3,3

flag_event mapflag nowarpto

flag_event mapflag nosave

flag_event mapflag nobranch

flag_event mapflag nopenalty

flag_event mapflag noreturn

flag_event mapflag nowarp

flag_event mapflag noicewall

flag_event mapflag nomemo

flag_event mapflag pvp

guild_room mapflag nowarpto

guild_room mapflag nosave

guild_room mapflag nobranch

guild_room mapflag noreturn

guild_room mapflag nowarp

guild_room mapflag nomemo

 

 

http://pastebin.com/PHLvbBV4

BG is suited for it, make them join in 2 teams of bg.

Other options are, if they are on same party/guild, you can have gvg mapflag and so on..

Share this post


Link to post
Share on other sites
  • 0

 

Hello, I need a help with this npc, how can I let the team 1 team not attack 2? I've tried all ways but it still fails.

 

 

//Author Goddameit

//Version 2012/06/09 - ''flag_event'' map

//Web http://bit.ly/Ja4udH

guild_room,236,283,4 script CTF Premiador 100,{

 

if($ctfevt == 0){ dispbottom "[CTF] Desculpe mais não tenho nara para você."; warp "SavePoint",0,0; end; }

 

query_sql "UPDATE `login` SET `ppoints` = `ppoints` +20 WHERE `account_id`='"+getcharid(3)+"'";

dispbottom "[CTF] Você acaba de ganhar 20 Peace Points";

warp "SavePoint",0,0;

end;

}

prontera,150,185,4 script CTF -1,{

 

OnInit:

bindatcmd ("CTF", "CTF::OnAtcmd_CTF");

set $ctfevt,0;

end;

 

OnClock0900: callsub EventoCTF;

OnClock1300: callsub EventoCTF;

OnClock1700: callsub EventoCTF;

OnClock0000: callsub EventoCTF;

 

 

EventoCTF:

announce "[CTF] A captura pela bandeira vai começar em 5 minutos, digite @ctf para se registrar.",8;

set $ctfevt,1;

initnpctimer;

end;

OnAtcmd_CTF:

if($ctfevt == 0){ dispbottom "[CTF] A captura pela bandeira não começou"; end; }

function c_flagon {

while(set(.@i,.@i+1)<=6)

{

if(getd("$@flag"+.@i+"_a")==getarg(0))

return .@i;

}

return 0;

}

dispbottom "[CTF] Você acaba de se registrar, espere até ser chamado.";

set @ctf_tid,.join==0?1:.join==1?2:.join%2;

setd ".join_j"+.join,getcharid(3);

set .join,.join+1;

close;

 

OnTimer600000:

set .w,0;

if(.ctf_tp1!=.ctf_tp2)

{

announce "[CTF] O Time "+set(.w,(.ctf_tp1>.ctf_tp2?1:2))+" capturou mais bandeiras e venceu.",0;

for(set .@io,0;.@io<=.join;set .@io,.@io+1)

{

if(attachrid(getd(".join_j"+.@io)))

{

getmapxy(@cm$,@cx,@cy,0);

if(@cm$=="flag_event")

{

if(.w==@ctf_tid)

{

warp "guild_room",236,283;

}else

warp "prontera",150,180;

}

setd ".join_j"+.@io,0;

deltimer "FlagTimer::OnTimerStart";

}

}

set .join,0;

}

mapwarp "flag_event","prontera",150,180;

mapannounce "flag_event","[CTF] Fim de jogo.",0;

end;

OnTimer1:

OnStart:

set .game,1;

set .join,0;

set .ctf_tn1,0;

set .ctf_tn2,0;

set .ctf_tp1,0;

set .ctf_tp2,0;

sleep2 300000;

set .game,2;

set $ctfevt,0;

setmapflag "flag_event",mf_pvp;

setmapflag "flag_event",mf_pvp_noguild;

removemapflag "flag_event",mf_gvg;

announce "[CTF] A captura pela bandeira começou.",0;

for(set .@io,0;.@io<=.join;set .@io,.@io+1)

{

if(attachrid(getd(".join_j"+.@io)))

{

if(@ctf_tid==2)

warp "flag_event",180,87;

else

warp "flag_event",33,93;

}

}

initnpctimer "CTF-Point#1";

initnpctimer "CTF-Point#2";

end;

OnPCDieEvent:

getmapxy(@cm$,@cx,@cy,0);

if(@cm$!="flag_event"||.game!=2) // ||!@ctf_tid

end;

addtimer 5000,"CTF-Point#"+@ctf_tid+"::OnDie";

OnPCEnd:

OnPCLogoutEvent:

set @ctf_tu,0;

set @CTF,0;

if(set(.@i,c_flagon(getcharid(0))))

{

deltimer "FlagTimer::OnTimerStart";

callfunc "CTF_LimitSkillWhenCareFlag",0;

getmapxy(.@cm$,.@cx,.@cy,0);

hideoffnpc "Flag#"+.@i;

stopnpctimer "Flag#"+.@i;

setd "$@flag"+.@i+"_a",0;

movenpc "Flag#"+.@i,.@cx,.@cy;

if(@ctf_xt&&@ctf_tid)

{

specialeffect2 666;

set @ctf_xt,0;

mapannounce "flag_event","[CTF] Time "+@ctf_tid+" +1 Ponto.",0;

setd ".ctf_tp"+@ctf_tid,getd(".ctf_tp"+@ctf_tid)+1;

mapannounce "flag_event","[CTF] Time 1 ["+.ctf_tp1+"] Pontos : Time 2 ["+.ctf_tp2+"] Pontos",0;

movenpc "Flag#"+.@i,107,90;

getmapxy(getvariableofnpc(.cm$,"Flag#"+.@i),getvariableofnpc(.cx,"Flag#"+.@i),getvariableofnpc(.cy,"Flag#"+.@i),1,"Flag#"+.@i);

}

end;

}

set @ctf_xt,0;

end;

}

flag_event,107,90,4 script Flag#1 722,{

if(getvariableofnpc(.game,"CTF")!=2) // ||!@ctf_tid

end;

function flag_tid {

if(getarg(0)<4)

return 1;

else

return 2;

}

set .k,atoi(strnpcinfo(2));

getmapxy(.cm$,.cx,.cy,1);

getmapxy(.@cm$,.@cx,.@cy,0);

if(pow(.cx-.@cx,2)>9||pow(.cy-.@cy,2)>9)

{

message strcharinfo(0),"Chegue mais perto oras.."+rand(1000)+""+rand(1000);

end;

}

if(@CTF)

end;

set @CTF,1;

setd "$@flag"+.k+"_a",getcharid(0);

hideonnpc strnpcinfo(0);

callfunc "CTF_LimitSkillWhenCareFlag",1;

addtimer 500,"FlagTimer::OnTimerStart";

end;

}

- script FlagTimer -,{

 

OnTimerStart:

set @ctf_tu,@ctf_tu+1;

if(@ctf_tu>120)

{

unitskilluseid getcharid(3),173,1;

doevent "CTF::OnPCEnd";

end;

}

specialeffect2 589;

addtimer 500,"FlagTimer::OnTimerStart";

end;

}

 

flag_event,33,93,4 script CTF-Point#1 111,3,3,{

end;

 

OnDie:

if(@ctf_tid==2)

warp "flag_event",180,87;

else

warp "flag_event",33,93;

end;

OnTouch:

if(getvariableofnpc(.game,"CTF")!=2||!@ctf_tid)

end;

if(@ctf_tid!=atoi(strnpcinfo(2)))

end;

set @ctf_xt,1;

doevent "CTF::OnPCEnd";

end;

 

OnTimer500:

specialeffect 225;

sleep(500);

specialeffect 236;

sleep(500);

specialeffect 237;

sleep(500);

specialeffect 238;

initnpctimer;

end;

}

flag_event,180,87,4 duplicate(CTF-Point#1) CTF-Point#2 45,3,3

flag_event mapflag nowarpto

flag_event mapflag nosave

flag_event mapflag nobranch

flag_event mapflag nopenalty

flag_event mapflag noreturn

flag_event mapflag nowarp

flag_event mapflag noicewall

flag_event mapflag nomemo

flag_event mapflag pvp

guild_room mapflag nowarpto

guild_room mapflag nosave

guild_room mapflag nobranch

guild_room mapflag noreturn

guild_room mapflag nowarp

guild_room mapflag nomemo

 

 

http://pastebin.com/PHLvbBV4

BG is suited for it, make them join in 2 teams of bg.

Other options are, if they are on same party/guild, you can have gvg mapflag and so on..

 

Yes, the problem is that I do not want the player to stand still in a chat in order to enter, want him to be free, and there is no command to the npc create two groups or two guilds to enter the event.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.