Jump to content
  • 0

HELP! NPC Prize


TheBossBrooks

Question


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  08/07/12
  • Last Seen:  

Please help. How can i put this NPC price every after the round.

Like a 2 vs 2 after then kill ng emp ng NPC will pop up and will give the prize,.

Help please need this one. Thanks

- script custom_bg#control -1,{
OnStart:
if ( getwaitingroomstate( 0, "Attack Team" ) != 2 || getwaitingroomstate( 0, "Defend Team" ) != 2 ) end;
set .endbykill, 0;
set .atkteam, waitingroom2bg( "prontera", 152,187, "", "", "Attack Team" );
set .defteam, waitingroom2bg( "prontera", 160,187, "", "", "Defend Team" );
delwaitingroom "Attack Team";
delwaitingroom "Defend Team";
bg_warp .atkteam, "bat_a01", 279,240;
bg_warp .defteam, "bat_a01", 274,164;
bg_monster .defteam, "bat_a01", 273,203, "--ja--", 1288, "custom_bg#control::OnEnd";
sleep 10000000; // 10 seconds to kill
if ( .endbykill )
announce "attacker won", 0;

else {
announce "defender won", 0;
killmonster "bat_a01", "custom_bg#control::OnEnd";
}
bg_destroy .atkteam;
bg_destroy .defteam;
donpcevent "Attack Team::OnInit";
donpcevent "Defend Team::OnInit";
end;

OnEnd:
set .endbykill, 1;
awake strnpcinfo(0);
end;
}

prontera,148,187,5 script Attack Team 417,{
end;
OnInit:
waitingroom "ATTACK",2,"custom_bg#control::OnStart",1;
end;
}
prontera,163,187,5 script Defend Team 417,{
end;
OnInit:
waitingroom "DEFEND",2,"custom_bg#control::OnStart",1;
end;
}

// Conquest Exit
bat_a01,272,198,5 script Exit#KoE 51,{
mes "[Exit]";
mes "See ya.";
if ( getcharid(2) == getcastledata("bat_a01",1) )
getitem 673, 1;
next;
warp "Save",0,0;
close;
}

bat_a01 mapflag battleground
bat_a01 mapflag gvg
bat_a01 mapflag nobranch
bat_a01 mapflag nomemo
bat_a01 mapflag nopenalty
bat_a01 mapflag noreturn
bat_a01 mapflag nosave SavePoint
bat_a01 mapflag noteleport
bat_a01 mapflag nowarp
bat_a01 mapflag nowarpto
bat_a01 mapflag noicewall
bat_a01 mapflag novending

Edited by Euphy
Codeboxed.
Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  43
  • Topics Per Day:  0.01
  • Content Count:  95
  • Reputation:   1
  • Joined:  01/20/12
  • Last Seen:  

if ( getcharid(2) == getcastledata("bat_a01",1) )

getitem 673, 1;

try mo to if ( getcharid(0) == getcastledata("bat_a01",1) )

getitem 673, 1;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

o.O

http://www.eathena.w...dpost&p=1517519

I strongly against having a npc pop up for receiving rewards

because all battleground script has a timeout to prevent player sit inside own the map for themself, other players no chance to play

so I suggest giving the rewards straight after event finish

set .atkteam, waitingroom2bg( "prontera", 152,187, "", "", "Attack Team" );

copyarray .atkteam_aid, $@arenamembers, $@arenamembersnum; // retrieve all account ID of offensive team

set .defteam, waitingroom2bg( "prontera", 160,187, "", "", "Defend Team" );

copyarray .defteam_aid, $@arenamembers, $@arenamembersnum; // retrieve all account ID of defensive team

if ( .endbykill ) {

announce "attacker won", 0;

for ( .@i = 0; .@i < 2; .@i++ )

getitem 673, 1, .atkteam_aid[.@i];

} else {

announce "defender won", 0;

for ( .@i = 0; .@i < 2; .@i++ )

getitem 673, 1, .defteam_aid[.@i];

killmonster "bat_a01", "custom_bg#control::onend";

}

Link to comment
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.   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.

×
×
  • Create New...