PDA

View Full Version : [JX] Help Cổng Binh Tử ( Lôi Đài ) Không Tự Chuyển Qua Đồ Sát Và Cho Dùng Thuốc Lag



newlife90
03-06-16, 07:45 AM
Như Tiêu đề Cổng Binh Tử ( Lôi Đài ) Không Tự Chuyển Qua Đồ Sát Và Cho Dùng Thuốc Lag
Pro nào chỉ hoặc share cho em cái thằng bw với . Vào Lôi Đài Mà Vẫn Chế Độ Chiến Đấu Và Còn Được Mang Cả Thuốc Lag Vào :(
hix

caunho1x9x
07-06-16, 12:55 PM
bạn copy nội dung dưới vào file script/missions/bw/bwmanager.lua
thay cái của bạn


Include("\\script\\task\\newtask\\branch\\branch_bwsj.lua")
Include("\\script\\missions\\bw\\bwhead.lua");


szCaptainName = {};
function main()
--ÉèÖ÷µ»Øµã
---dofile("script/missions/bw/bwmanager.lua")
x,y,z = GetWorldPos();
SetTask(BW_SIGNPOSWORLD, x);
SetTask(BW_SIGNPOSX, y);
SetTask(BW_SIGNPOSY, z);
szCaptainName = bw_getcaptains(); --»ñÈ¡Á½¶Ó¶Ó³¤µÄÃû×Ö£»

idx = SubWorldID2Idx(BW_COMPETEMAP[1]);
if (idx == -1) then
ErrorMsg(3)
return
end;

OldSubWorld = SubWorld;
SubWorld = idx;
local MemberCount =GetMissionV(MS_MAXMEMBERCOUNT)
ms_state = GetMissionV(MS_STATE);
if (ms_state == 0) then
Say(15665, 3, "<#15666>/OnRegister", "<#15667>/OnHelp", "<#15668>/OnCancel");
elseif (ms_state == 1) then
Say("<#15669> <color=yellow>"..szCaptainName[1].."<color> <#15670> <color=yellow>"..szCaptainName[2].."<color> <#15654> <color=yellow>"..MemberCount.." VS "..MemberCount.."<color> <#15671>",4,"Ta lµ ®éi tr­ëng, muèn biÕt sè thø tù vµo ®Êu tr­êng./OnShowKey", "<#15672>/OnEnterMatch", "<#15673>/OnLook", "<#15674>/OnCancel")
elseif (ms_state == 2) then
OnFighting();
else
ErrorMsg(2)
end;
SubWorld = OldSubWorld;
end;

WLLS_FORBID_ITEM = {
{ " c«ng tèc hoµn ", {6, 1, 218, -1, 0, 0}, 511 },
{ " ch¹y tèc hoµn ", {6, 1, 219, -1, 0, 0}, 512 },
{ " phæ phßng hoµn ", {6, 1, 220, -1, 0, 0}, 513 },
{ " ®éc phßng hoµn ", {6, 1, 221, -1, 0, 0}, 514 },
{ " b¨ng phßng hoµn ", {6, 1, 222, -1, 0, 0}, 515 },
{ " löa phßng hoµn ", {6, 1, 223, -1, 0, 0}, 516 },
{ " l«i phßng hoµn ", {6, 1, 224, -1, 0, 0}, 517 },
{ " gi¶m th­¬ng hoµn ", {6, 1, 225, -1, 0, 0}, 518 },
{ " gi¶m ngÊt hoµn ", {6, 1, 226, -1, 0, 0}, 519 },
{ " gi¶m ®éc hoµn ", {6, 1, 227, -1, 0, 0}, 520 },
{ " gi¶m b¨ng hoµn ", {6, 1, 228, -1, 0, 0}, 521 },
{ " phæ c«ng hoµn ", {6, 1, 229, -1, 0, 0}, 522 },
{ " ®éc c«ng hoµn ", {6, 1, 230, -1, 0, 0}, 523 },
{ " b¨ng c«ng hoµn ", {6, 1, 231, -1, 0, 0}, 524 },
{ " löa c«ng hoµn ", {6, 1, 232, -1, 0, 0}, 525 },
{ " l«i c«ng hoµn ", {6, 1, 233, -1, 0, 0}, 526 },
{ " tr­êng mÖnh hoµn ", {6, 1, 234, -1, 0, 0}, 527 },
{ " tr­êng bªn trong hoµn ", {6, 1, 235, -1, 0, 0}, 528 },
{ " an hång ®an ", {6, 1, 115, -1, 0, 0}, 450 },
{ " x· lam ®an ", {6, 1, 116, -1, 0, 0}, 451 },
{ " bªn trong phæ hoµn ", {6, 1, 117, -1, 0, 0}, 453 },
{ " bªn trong ®éc hoµn ", {6, 1, 118, -1, 0, 0}, 454 },
{ " bªn trong b¨ng hoµn ", {6, 1, 119, -1, 0, 0}, 455 },
{ " néi háa hoµn ", {6, 1, 120, -1, 0, 0}, 456 },
{ " bªn trong l«i hoµn ", {6, 1, 121, -1, 0, 0}, 457 },
{ " tr­êng mÖnh hoµn ", {6, 0, 1, -1, 0, 0}, 256 },
{ " thªm ch¹y hoµn ", {6, 0, 2, -1, 0, 0}, 257 },
{ " ®¹i lùc hoµn ", {6, 0, 3, -1, 0, 0}, 258 },
{ " cao nhanh chãng hoµn ", {6, 0, 4, -1, 0, 0}, 259 },
{ " trung häc ®Ö nhÞ cÊp hoµn ", {6, 0, 5, -1, 0, 0}, 260 },
{ " nhanh chãng hoµn ", {6, 0, 6, -1, 0, 0}, 261 },
{ " b¨ng phßng hoµn ", {6, 0, 7, -1, 0, 0}, 262 },
{ " l«i phßng hoµn ", {6, 0, 8, -1, 0, 0}, 263 },
{ " löa phßng hoµn ", {6, 0, 9, -1, 0, 0}, 264 },
{ " ®éc phßng hoµn ", {6, 0, 10, -1, 0, 0}, 265 },
{ " lËt tö tèng tö ", {6, 0, 60, -1, 0, 0}, 401 },
{ " thÞt heo tèng tö ", {6, 0, 61, -1, 0, 0}, 402 },
{ " thÞt bß tèng tö ", {6, 0, 62, -1, 0, 0}, 403 },
{ " tr¨m qu¶ lé ", {6, 1, 73, -1, 0, 0}, 442 },
{ " c¸t t­êng bao tiÒn l× x× ", {6, 1, 19, -1, 0, 0}, 442 },
{ " hoµng kim b¶o r­¬ng ", {6, 1, 69, -1, 0, 0}, 442},
{ " méc lÖnh bµi tin/th¬ khiÕn cho ", {6, 1, 885, -1, 0 ,0}, 542},
{ " ®ång lÖnh bµi tin/th¬ khiÕn cho ", {6, 1, 886, -1, 0 ,0}, 543},
{ " ng©n lÖnh bµi tin/th¬ khiÕn cho ", {6, 1, 887, -1, 0 ,0}, 544},
{ " kim lÖnh bµi tin/th¬ khiÕn cho ", {6, 1, 888, -1, 0 ,0}, 545},
{ " ngù tø tin/th¬ khiÕn cho lÖnh bµi ", {6, 1, 889, -1, 0 ,0}, 546},
{ " tói viªn thuèc ", {6, 1, 910, -1, 0 ,0}, 635},
{ " thÇn bÝ bao tiÒn l× x× hép quµ ", {6, 1, 1074, -1, 0 ,0}, 635},
{ " hép quµ [ huy hoµng qu¶ ]", {6, 1, 1075, -1, 0 ,0}, 635},
{ " ng­êi gi¶ ", {6, 1, 1389, -1, 0, 0}, 635 },
-- script viet hoa By <b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b> tinhpn 20100720: forbid item
{ " håi thiªn t¸i t¹o cÈm nang ", {6, 1, 1781, -1, 0, 0},635},
{ " méc chÕ b¶o hép ", {6, 1, 2318, -1, 0, 0},635},
{ " lµm b»ng ®ång b¶o hép ", {6, 1, 2319, -1, 0, 0},635},
{ " lµm b»ng b¹c b¶o hép ", {6, 1, 2320, -1, 0, 0},635},
{ " hoµng kim b¶o r­¬ng ", {6, 1, 2321, -1, 0, 0},635},
{ " b¹ch kim b¶o r­¬ng ", {6, 1, 2322, -1, 0, 0},635},
{ " s¸t thñ bÝ b¶o ", {6, 1, 2347, -1, 0, 0},635},
{ " d· tÈu thÇn bÝ b¶o r­¬ng ", {6, 1, 2374, -1, 0, 0},635},
{ " chÝ t«n bÝ b¶o ", {6, 1, 2375, -1, 0, 0},635},
{ " n­íc tÆc tµi b¶o ", {6, 1, 2376, -1, 0, 0},635},
{ " håi thiªn t¸i t¹o lÔ tói ", {6, 1, 2527, -1, 0, 0},635},
{ " nhanh chãng hoµn lÔ tói ", {6, 1, 2520, -1, 0, 0},635},
{ " ®¹i lùc hoµn lÔ tói ", {6, 1, 2517, -1, 0, 0},635},
-- script viet hoa By <b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b> Updated by DinhHQ - 20110425
{ " c«ng thµnh chiÕn lÔ tói ", {6, 1, 2377, -1, 0, 0},635},
{ " ®éc phßng hoµn lÔ tói ", {6, 1, 2524, -1, 0, 0},635},
{ " tr­êng mÖnh hoµn lÔ tói ", {6, 1, 2515, -1, 0, 0},635},
{ " gia tèc hoµn lÔ tói ", {6, 1, 2516, -1, 0, 0},635},
{ " cao nhanh chãng hoµn lÔ tói ", {6, 1, 2518, -1, 0, 0},635},
{ " trung häc ®Ö nhÞ cÊp hoµn lÔ tói ", {6, 1, 2519, -1, 0, 0},635},
{ " nhanh chãng hoµn lÔ tói ", {6, 1, 2520, -1, 0, 0},635},
{ " b¨ng phßng hoµn lÔ tói ", {6, 1, 2521, -1, 0, 0},635},
{ " l«i phßng hoµn lÔ tói ", {6, 1, 2522, -1, 0, 0},635},
{ " löa phßng hoµn lÔ tói ", {6, 1, 2523, -1, 0, 0},635},
{ " ®éc phßng hoµn lÔ tói ", {6, 1, 2524, -1, 0, 0},635},
{ " vi s¬n lÖnh bµi lÔ tói ", {6, 1, 2525, -1, 0, 0},635},
{ " hoµn hån ®an lÔ tói ", {6, 1, 2830, -1, 0, 0},635},
{ " tiªu dao t¸n ", {6, 1, 2831, -1, 0, 0},635},
{ " hoµn hån ®an ", {6, 1, 2837, -1, 0, 0},635},
}

function OnRegister()
--±¨Ãû
if (GetTeamSize() ~= 2) then
Say(15675, 0);
return
end;

if (IsCaptain() ~= 1) then
ErrorMsg(5)
return
end;




Say(15676, 5, "<#15677>/OnCancel", "1 chäi 1/#SignUpFinal(1)", "2 chäi 2/#SignUpFinal( 2 )", "5 chäi 5/#SignUpFinal( 5 )","8 chäi 8/#SignUpFinal( 8 )");
end;

function SignUpFinal(MemberCount)
if (GetTeamSize() ~= 2) then
Say(15675, 0);
return
end;

if (MemberCount <= 0 or MemberCount > 8) then
return
end

local OldSubWorld = SubWorld;
SubWorld = SubWorldID2Idx(BW_COMPETEMAP[1]);
ms_state = GetMissionV(MS_STATE);

if (ms_state ~= 0) then
ErrorMsg(8)
return
end
OpenMission(BW_MISSIONID);
local x = GetTask(BW_SIGNPOSWORLD);
-- if x == 80 then
-- SetMissionS(CITYID,"ÑïÖÝ")
-- elseif x == 78 then
-- SetMissionS(CITYID,"ÏåÑô")
-- else
-- SetMissionS(CITYID,"³É¶¼")
-- end;
SetMissionS(CITYID, REVIVE_ID[x].szMapName)
local key = {};
key = bw_getkey();
SetMissionV(MS_TEAMKEY[1], key[1]);
SetMissionV(MS_TEAMKEY[2], key[2]);

OldPlayerIndex = PlayerIndex;
for i = 1, 2 do
PlayerIndex = GetTeamMember(i);
SetMissionS(i, GetName());
szCaptainName = bw_getcaptains(); --»ñÈ¡Á½¶Ó¶Ó³¤µÄÃû×Ö£»
if (MemberCount > 1) then
Msg2Player("<#15678>:<color=yellow>["..key[i].."]<color=>,<#15679>");
local szMsg = format("<#15680> %s chäi %s <#15681>%d<#15682><color=yellow>[%d]<color=>,<#15683>",MemberCount, MemberCount, floor(GO_TIME_GPZ/3),key[i])
Say(szMsg,0)

end
branchTask_BW1() --ºÍÈÎÎñÏà¹Ø£¬²Î¼ÓÁ˱ÈÈü½øРмÆÊý
end;

PlayerIndex = OldPlayerIndex;
SetMissionV(MS_MAXMEMBERCOUNT, MemberCount)
SubWorld = OldSubWorld;
str = "<#15685> "..GetMissionS(CITYID)..szCaptainName[1].." <#15686> "..szCaptainName[2].." <#15687> "..szCaptainName[1].." <#15688> "..szCaptainName[2].." <#15689>";
AddGlobalNews(str);
local szMsg = format("Ng­¬i ®· ®¨ng ký thi ®Êu gi÷a %s chäi %s h·y may nhanh chãng vµo ®Êu tr­êng, %d trËn ®Êu sÏ chÝnh thøc b¾t ®Çu sau ",MemberCount, MemberCount, floor(GO_TIME_GPZ/3))
Msg2Team(szMsg);
end;

function bw_getkey()
local key = {};
key[1] = random(1, 9999)
key[2] = random(1, 9999)

--±£Ö¤key1 key2>0, key1 ~= key2
if (key[2] == key[1]) then
if (key[1] < 9996) then
key[2] = key[1] + 3
else
key[2] = key[1] - 3;
end
end
return key;
end;



function OnHelp()
Talk(3, "", "<#15693>", "<#15694>", "<#15695>", format("C«ng B×nh Tö: Sau khi ®¨ng ký thµnh c«ng, hai bªn cã thÓ vµo khu vùc chuÈn bÞ, thêi gian chuÈn bÞ lµ <color=yellow>%d<color> phót, sau khi thêi gian chuÈn bÞ kÕt thóc, trËn ®Êu sÏ chÝnh thøc b¾t ®Çu!", floor(GO_TIME_GPZ/3)) , format("C«ng B×nh Tö: Thêi gian thi ®Êu lµ <color=yellow>%d<color> phót, nÕu trong %d phót kh«ng x¸c ®Þnh ®­îc ®éi th¾ng, trËn ®Êu sÏ ®­îc xö hßa.", floor(TIMER_2/(60*FRAME2TIME))-floor(GO_TIME_GPZ/3), floor(TIMER_2/(60*FRAME2TIME))-floor(GO_TIME_GPZ/3) ));
end;

function OnEnterMatch()

for i = 1, getn(WLLS_FORBID_ITEM) do
forbiditem_con = CalcEquiproomItemCount( WLLS_FORBID_ITEM[i][2][1], WLLS_FORBID_ITEM[i][2][2], WLLS_FORBID_ITEM[i][2][3], WLLS_FORBID_ITEM[i][2][4] )
if (forbiditem_con > 0) then

Talk(1, "", "Khi Tham gia CBT k ®­îc mang theo vËt dông nh­ thuèc lag hay m¸u xu vµo thi ®Êu.<enter>Vui Lßng b¸n hÕt hay cÊt l¹i t¹i thïng ®å! ");
return
end
forbiditem_con = CalcItemCount( 1, WLLS_FORBID_ITEM[i][2][1], WLLS_FORBID_ITEM[i][2][2], WLLS_FORBID_ITEM[i][2][3], WLLS_FORBID_ITEM[i][2][4] )
if (forbiditem_con > 0) then
Talk(1, "", "Khi Tham gia CBT k ®­îc mang theo vËt dông nh­ thuèc lag hay m¸u xu vµo thi ®Êu.<enter>Vui Lßng b¸n hÕt hay cÊt l¹i t¹i thïng ®å! ");
return
end

end

local OldSubWorld = SubWorld;
SubWorld = SubWorldID2Idx(BW_COMPETEMAP[1]);
if (SubWorld < 0) then
return
end;

if ((GetName() == szCaptainName[1]) or (GetName() == szCaptainName[2])) then
OnJoin(0) --ÕâÀïºÅÂëʲô¶¼¿ÉÒÔ the only param stand for the group ID;
else
Say("<#15696>",2, "<#15697>/OnEnterKey", "<#15698>/OnCancel")
end;
SubWorld = OldSubWorld;
end

function OnEnterKey()
AskClientForNumber("OnEnterKey1", 0, 10000, "<#15699>");
end

function OnEnterKey1(Key)
local OldSubWorld = SubWorld;
SubWorld = SubWorldID2Idx(BW_COMPETEMAP[1]);
if (SubWorld < 0) then
SubWorld = OldSubWorld;
return
end;
if (Key == GetMissionV(MS_TEAMKEY[1])) then
OnJoin(1)
elseif (Key == GetMissionV(MS_TEAMKEY[2])) then
OnJoin(2)
else
Say(15700,0)
end
SubWorld = OldSubWorld;
end

function OnLook()
idx = SubWorldID2Idx(BW_COMPETEMAP[1]);
OldSubWorld = SubWorld;
SubWorld = idx;
local str = szCaptainName[1].."<#15701>"..szCaptainName[2].."<#15702>";
local str1 = "<#15703>/onwatch";
Say(str, 2, str1, "<#15704>/OnCancel");
SubWorld = OldSubWorld;
end;

function onwatch()
OldSubWorld = SubWorld;
local idx = SubWorldID2Idx(BW_COMPETEMAP[1]);
if (idx == -1) then
return
end;
SubWorld = idx;
if (GetName() == szCaptainName[1]) or (GetName() == szCaptainName[2]) then
SubWorld = OldSubWorld
OnJoin(0) --¶Ó³¤²»ÄܽøÐйÛÕ½
else
OnJoin(3); --¼ÓÈëµ½¹ÛÖÚµÄ
end;
end

--to join in a fight group group --×é
function OnJoin(group)
idx = SubWorldID2Idx(BW_COMPETEMAP[1]);
if (idx < 0) then
return
end;
OldSubWorld = SubWorld;
SubWorld = idx;
if (GetName() == szCaptainName[1]) then
JoinCamp(1)
elseif (GetName() == szCaptainName[2]) then
JoinCamp(2)
elseif (group == 1 or group == 2) then
local masteridx = SearchPlayer(GetMissionS(group))
local masternum = 0
if (masteridx > 0) then
if (PIdx2MSDIdx(BW_MISSIONID, masteridx) > 0) then
masternum = 1
end
end
if (GetMSPlayerCount(BW_MISSIONID, group) - masternum < GetMissionV(MS_MAXMEMBERCOUNT) - 1) then
JoinCamp(group)
else
ErrorMsg(10)
end;
elseif (group == 3) then
JoinCamp(3);
else
ErrorMsg(4)
end;
SubWorld=OldSubWorld;
BWDamageStat:StartPersonalStat(PlayerIndex);
end;

function OnFighting()
str = "<#15705> "..szCaptainName[1].."<#15701> "..szCaptainName[2].."<#15706>";
Say(str, 1, "<#15707>/OnCancel");
end;

function OnCancel()
end;

function ErrorMsg(ErrorId)
if (ErrorId == 1) then
Say(15708,0)
elseif (ErrorId == 2) then
Say(15709,0)
elseif (ErrorId == 3) then
Say(15710,0);
elseif (ErrorId == 4) then
Say(15711, 0);
elseif (ErrorId == 5) then
Say(15712,0);
elseif (ErrorId == 6) then
Say(15713,0);
elseif (ErrorId == 7) then
Say(15714,0);
elseif (ErrorId == 8) then
Say(15715,0);
elseif (ErrorId == 9) then
Say(15716,0);
elseif (ErrorId == 10) then
Say(15717,0);
else

end;
return
end;


với file bwhead.lua


IncludeLib("RELAYLADDER")
Include("\\script\\task\\newtask\\branch\\branch_bwsj.lua")
Include("\\script\\missions\\bw\\bwdamagestat.lua")
--Í˳öÓÎÏ·ºóµÄÖØÉúµãID,Ò²¾ÍÊ� �±¨ÃûµÄÄǸöµØ·½°É
CS_RevId = 80;
CS_RevData = 36;

REVIVE_ID =
{
[11] = {szMapName = "<#15751>", nPosId = 1,nMapId = 235},
[78] = {szMapName = "<#15752>", nPosId = 1,nMapId = 236},
[80] = {szMapName = "<#15753>", nPosId = 1,nMapId = 237},
[238] = {szMapName = "<#15754>", nPosId = 1,nMapId = 238},
}

BW_PREPARATION_FIELD_ID = {235, 236, 237, 238};
--»á³¡ÍâµÄλÖÃ
BW_COMPETEMAP = {209, 210, 211};

--¼ÓÈëË«·½ÕóӪʱµÄλÖÃ
CS_CampPos = { {209, 1621, 3198}, --×ÏÉ«
{209, 1612, 3187}, --ÂÌÉ«
{209, 1628, 3215}, --¹ÛÕ½ÕßµÄλÖð×É«
};
CS_CamperPos = {
{1599, 3202, "Tr­¬ng Tam"},
{1608, 3211, "Tr­¬ng Tø"},
}
FRAME2TIME = 18;
--ÓÎÏ·µÄ×î´óÈËÊý
MAX_MEMBER_COUNT = 100;
--´æ´¢Íæ¼ÒµÄλÖõÄÈÎÎñ±äÁ¿
BW_SIGNPOSWORLD = 300;
BW_SIGNPOSX = 301;
BW_SIGNPOSY = 302;
MS_STATE = 1;
MS_MAXMEMBERCOUNT = 2;
CITYID = 6; --³ÇÊÐID
BW_KEY = 7; -- 0-100000000µÄËæ»úÊý
MS_NEWSVALUE = 9; --ÈÎÎñÖдæ·ÅÐÂÎűäÁ¿µÄµØ·½
MS_TEAMKEY = {10, 11};

MSS_CAPTAIN = {1, 2};
BW_SMALLTIME_ID = 10; --¶¨Ê±´¥·¢Æ÷
BW_TOTALTIME_ID = 11;
TIMER_1 = 20 * FRAME2TIME; -- 20Ã빫²¼Ò»ÏÂÕ½¿ö
TIMER_2 = 12 * 3 * TIMER_1 ; --½»Õ½×Üʱ¼äΪ10+2·ÖÖÓ

GO_TIME_GPZ = 6; -- ±¨Ãûʱ¼äΪ2·ÖÖÓ
BW_MISSIONID = 4;

function Msg2AllPreparationFields(msg)
if msg == nil or msg == "" then
return nil;
end

local nOldSubWorld = SubWorld;
for i = 1, getn(BW_PREPARATION_FIELD_ID) do
SubWorld = SubWorldID2Idx(BW_PREPARATION_FIELD_ID[i]);
Msg2SubWorld(msg);
end

SubWorld = nOldSubWorld;
end

function BW_SetRev()
-- if (GetTask(BW_SIGNPOSWORLD) == 80) then
-- SetRevPos(CS_RevId, CS_RevData)
-- elseif (GetTask(BW_SIGNPOSWORLD) == 78) then
-- SetRevPos(29);--xy
-- else
-- SetRevPos(6);--cd
-- end;
local nSignPosMapId = GetTask(BW_SIGNPOSWORLD)
SetRevPos(nSignPosMapId, REVIVE_ID[nSignPosMapId].nPosId)
end;

--Íæ¼ÒÒªÇóÀ뿪ÓÎÏ·
function LeaveGame()
local nGroupId = GetCurCamp() - 1
BWDamageStat:FetchDamageToGroup(PlayerIndex, nGroupId)

camp = GetCamp();--»Ö¸´Ô­Ê¼ÕóÓª
SetFightState(0)
if (GetCurCamp() == 2) then
LeaveChannel(PlayerIndex, "L«i ®µi nhiÒu ng­êi bªn Gi¸p");
elseif (GetCurCamp() == 3) then
LeaveChannel(PlayerIndex, "L«i ®µi nhiÒu ng­êi bªn Êt");
end;
SetTaskTemp(200,0);
SetPunish(1)--ÉèÖÃPK³Í·£
SetPKFlag(0)--¹Ø±ÕPK¿ª¹Ø
ForbidChangePK(0);
RestoreOwnFeature()
--´ò¿ª½»Ò×°Ú̯
DisabledStall(0); --°Ú̯
ForbitTrade(0); --½»Ò×
SetCurCamp(GetCamp());
DisabledUseTownP(0)
ForbidEnmity(0);
DelMSPlayer(BW_MISSIONID, PlayerIndex);
SetLogoutRV(0);--ÉèÖÃÖØÉúµã
SetCreateTeam(1);
SetDeathScript("");--ÉèÖÃËÀÍö½Å±¾Îª¿Õ
ForbitStamina(0)
BWDamageStat:FinishPersonalStat(PlayerIndex)
end;

function GameOver()
PTab = {};
idx = 0;
local i;
local j = 1;
for i = 1, 500 do
idx , pidx = GetNextPlayer(BW_MISSIONID, idx, 0);

if (pidx > 0) then
PTab[j] = pidx;
j = j + 1;
end;
if (idx == 0 ) then
break
end
end

PCount = getn(PTab);
OldPlayer = PlayerIndex;
for i = 1, PCount do
PlayerIndex = PTab[i];
DelMSPlayer(BW_MISSIONID, PlayerIndex);
NewWorld(GetTask(BW_SIGNPOSWORLD), GetTask(BW_SIGNPOSX), GetTask(BW_SIGNPOSY));
end;
PlayerIndex = OldPlayer;

end;

function JoinCamp(Camp)
--ÔÚµÚ¶þMissionÄÚ¼Óµ±Ç°Íæ¼Ò
LeaveTeam()
local Camp1;
if (Camp == 3) then
Camp1 = 0;
else
Camp1 = Camp + 1;
end
AddMSPlayer(BW_MISSIONID, Camp);
SetCurCamp(Camp1)
bw_state_joined_in(Camp1);

if (Camp == 1) then
NewWorld(CS_CampPos[1][1], CS_CampPos[1][2], CS_CampPos[1][3])
EnterChannel(PlayerIndex, "L«i ®µi nhiÒu ng­êi bªn Gi¸p");
elseif (Camp == 2) then
NewWorld(CS_CampPos[2][1], CS_CampPos[2][2], CS_CampPos[2][3])
EnterChannel(PlayerIndex, "L«i ®µi nhiÒu ng­êi bªn Êt");
else
NewWorld(CS_CampPos[3][1], CS_CampPos[3][2], CS_CampPos[3][3])
end;

str = GetName().." ®· vµo ®Êu tr­êng thi ®Êu."
Msg2MSAll(BW_MISSIONID, str);
end;

function bw_state_joined_in(Camp)
--ÉèÖÃÓë°ï»áÓйصıäÁ¿£¬²»Ô ÊÐíÔÚ¾º¼¼³¡Õ½¸Ä±äij¸ö°ï»á ÕóÓªµÄ²Ù×÷
SetTaskTemp(200,1);

--ÉèÖÃÕ½¶·×´Ì¬
SetFightState(0);

--Íæ¼ÒÍ˳öʱ£¬±£´æRV²¢£¬ÔÚÏ ´ÎµÈÈëʱÓÃRV(³ÇÊÐÖØÉúµã£¬·� �Í˳öµã)
SetLogoutRV(1);

--ÎÞËÀÍö³Í·£
SetPunish(0);

ForbidEnmity(1);

--½ûÖ¹½»Ò×°Ú̯
DisabledStall(1); --°Ú̯
ForbitTrade(1); --½»Ò×

--¹Ø±Õ×é¶Ó¹¦ÄÜ
SetCreateTeam(0);

--´ò¿ªPK¿ª¹Ø
if (Camp == 0) then
SetPKFlag(0)
ChangeOwnFeature(0, 0, -1, -1, -1, -1, -1)
--Msg2Player("ϵͳÏûÏ¢£ºÄãÔÝʱ±äΪÒþÉí× ´Ì¬¡£");
else
SetPKFlag(2)
end;
ForbidChangePK(1);
DisabledUseTownP(1)

--ÉèÖÃÖØÉúµã£¬Ò»°ãÊÇÑ¡Ôñ½øÈ ë¸ÃÇøµÄ³ÇÊÐ
BW_SetRev()

--ÉèÖõ±Ç°Íæ¼ÒµÄËÀÍö½Å±¾
SetDeathScript("\\script\\missions\\bw\\bwdeath.lua");

--ÉèÖÃÏ´ÎËÀÍöµÄÖØÉúµã

x = GetTask(BW_SIGNPOSWORLD);
y = GetTask(BW_SIGNPOSX);
z = GetTask(BW_SIGNPOSY);
SetTempRevPos(x, y * 32, z * 32);
end;

--µÃµ½Á½¸ö¶Ó³¤µÄÃû×Ö
function bw_getcaptains()
local OldSubWorld = SubWorld;
local idx = SubWorldID2Idx(209);
local szCaptainName = {};
if (idx == -1) then
return szCaptainName;
end;
SubWorld = idx;
szCaptainName[1] = GetMissionS(MSS_CAPTAIN[1]);
szCaptainName[2] = GetMissionS(MSS_CAPTAIN[2]);
SubWorld = OldSubWorld;
return szCaptainName;
end;

function OnShowKey()
OldSubWorld = SubWorld;
SubWorld = SubWorldID2Idx(209);
if (SubWorld < 0) then
return
end;
local szCaptainName = {};
local szCaptainName = bw_getcaptains();
if (GetMissionV(MS_MAXMEMBERCOUNT) <= 1) then
Say(15661,0);
SubWorld = OldSubWorld;
return
end
local key = 0
if (GetName() == szCaptainName[1]) then
key = GetMissionV(MS_TEAMKEY[1]);
end

if (GetName() == szCaptainName[2]) then
key = GetMissionV(MS_TEAMKEY[2]);
end
if (key == 0) then
Say(15662,0)
else
Say("<#15663><color=yellow>["..key.."]<color><#15664>", 0);
end
SubWorld = OldSubWorld;
end

function bw_branchtask_win(nGroupID) --¸øʤµÄÒ»·½×÷Éϱê¼Ç
nOldPlayer = PlayerIndex;
--ʤÀûµÄÒ»¶Ó£»
local idx = 0;
local pidx;
for i = 1, 10 do
idx , pidx = GetNextPlayer(BW_MISSIONID, idx, nGroupID);
if (pidx > 0) then
PlayerIndex = pidx;
branchTask_GainBW1() --±£³ÖÈÃÿһ¸öÍæ¼ÒʤÀûʱ½øРеǼǣ»
end;
if (idx == 0) then
break;
end;
end
PlayerIndex = nOldPlayer;
end;


rồi thử rs sv xem sao nhé.
ở trên mình lấy bên liên đấu cái cấm mang thuốc vào CBT và khi vào oánh nhau thì sẽ chuyển sang chế độ Đồ Sát.