visaothe123
04-08-16, 01:41 PM
hix, thấy có máy sv đi TK, giết người ramdom nhận đồng or tiền du long, mình có dev nhưng k thành công k biết là dùng hàm code gì nữa, bác nào cho xin cái hướng dẫn or file phần thưởng với, tks trước ạ.
sice1995
07-08-16, 11:14 PM
\script\mission\battle\mission.lua
Bạn có thể thao khảo tại đây. Và dòng này
function tbMSBase:OnDeath(pKillerNpc)
-- 不是在比赛时间内不能加分
if (2 ~= self.nState) then
return 0;
end
local pPlayer = me;
local nGroupId = self:GetPlayerGroupId(pPlayer);
assert(nGroupId > 0);
self.tbRule:OnLeave(pPlayer);
local tbDeathBattleInfo = Battle:GetPlayerData(pPlayer);
self.tbCamps[nGroupId]:OnPlayerDeath(tbDeathBattleInfo);
local pKillerPlayer = pKillerNpc.GetPlayer();
if (pKillerPlayer) then
local nKillerGroupId = self:GetPlayerGroupId(pKillerPlayer);
assert(nKillerGroupId > 0);
if (nKillerGroupId == nGroupId) then
return;
end
local tbKillerBattleInfo = Battle:GetPlayerData(pKillerPlayer);
if tbDeathBattleInfo.nRank > 1 then
if tbDeathBattleInfo.nRank == 2 and tbDeathBattleInfo.pPlayer.GetTask(4002,1) >= 5 then
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - 5); -- nguoi bi kill
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + 10); -- nguoi kill
local szMsg = string.format("%s %s <color=yellow>%s<color> đập bể đầu %s %s <color=yellow>%s<color> cướp được <color=yellow>10 Điểm Phúc Duyên<color>",
Battle.NAME_CAMP[nKillerGroupId], Battle.NAME_RANK[tbKillerBattleInfo.nRank], tbKillerBattleInfo.pPlayer.szName,Battle.NAME_CAMP[nGroupId], Battle.NAME_RANK[tbDeathBattleInfo.nRank], tbDeathBattleInfo.pPlayer.szName);
KDialog.MsgToGlobal(szMsg);
elseif tbDeathBattleInfo.nRank == 1 and tbDeathBattleInfo.pPlayer.GetTask(4002,1) > 0 then -- ////
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - tbDeathBattleInfo.pPlayer.GetTask(4002,1));-- nguoi bi kill
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + tbDeathBattleInfo.pPlayer.GetTask(4002,1)); -- nguoi kill
tbKillerBattleInfo.pPlayer.Msg("Lục xoát khắp người "..tbDeathBattleInfo.pPlayer.szName.." tìm được "..tbKillerBattleInfo.pPlayer.GetTask(4002,1).." điểm phúc duyên.");
elseif tbDeathBattleInfo.nRank == 3 and tbDeathBattleInfo.pPlayer.GetTask(4002,1) >= 20 then
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - 20); -- nguoi bi kill
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + 40); -- nguoi kill
local szMsg = string.format("%s %s <color=yellow>%s<color> đập bể đầu %s %s <color=yellow>%s<color> cướp được <color=yellow>40 Điểm Phúc Duyên<color>",
Battle.NAME_CAMP[nKillerGroupId], Battle.NAME_RANK[tbKillerBattleInfo.nRank], tbKillerBattleInfo.pPlayer.szName,Battle.NAME_CAMP[nGroupId], Battle.NAME_RANK[tbDeathBattleInfo.nRank], tbDeathBattleInfo.pPlayer.szName);
KDialog.MsgToGlobal(szMsg);
elseif tbDeathBattleInfo.nRank == 3 and tbDeathBattleInfo.pPlayer.GetTask(4002,1) > 0 then -- ////
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - tbDeathBattleInfo.pPlayer.GetTask(4002,1));-- nguoi bi kill
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + tbDeathBattleInfo.pPlayer.GetTask(4002,1)); -- nguoi kill
tbKillerBattleInfo.pPlayer.Msg("Lục xoát khắp người "..tbDeathBattleInfo.pPlayer.szName.." tìm được "..tbKillerBattleInfo.pPlayer.GetTask(4002,1).." điểm phúc duyên.");
elseif tbDeathBattleInfo.nRank == 4 and tbDeathBattleInfo.pPlayer.GetTask(4002,1) >= 50 then
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - 50); -- nguoi bi kill
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + 100); -- nguoi kill
local szMsg = string.format("%s %s <color=yellow>%s<color> đập bể đầu %s %s <color=yellow>%s<color> cướp được <color=yellow>100 Điểm Phúc Duyên<color>",
Battle.NAME_CAMP[nKillerGroupId], Battle.NAME_RANK[tbKillerBattleInfo.nRank], tbKillerBattleInfo.pPlayer.szName,Battle.NAME_CAMP[nGroupId], Battle.NAME_RANK[tbDeathBattleInfo.nRank], tbDeathBattleInfo.pPlayer.szName);
KDialog.MsgToGlobal(szMsg);
elseif tbDeathBattleInfo.nRank == 4 and tbDeathBattleInfo.pPlayer.GetTask(4002,1) > 0 then -- ////
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - tbDeathBattleInfo.pPlayer.GetTask(4002,1));-- nguoi bi kill
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + tbDeathBattleInfo.pPlayer.GetTask(4002,1)); -- nguoi kill
tbKillerBattleInfo.pPlayer.Msg("Lục xoát khắp người "..tbDeathBattleInfo.pPlayer.szName.." tìm được "..tbKillerBattleInfo.pPlayer.GetTask(4002,1).." điểm phúc duyên.");
elseif tbDeathBattleInfo.nRank == 5 and tbDeathBattleInfo.pPlayer.GetTask(4002,1) >= 150 then -- ////
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - 150); -- nguoi bi kill
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + 300); -- nguoi kill
local szMsg = string.format("%s %s <color=yellow>%s<color> đập bể đầu %s %s <color=yellow>%s<color> cướp được <color=yellow>300 Điểm Phúc Duyên<color>",
Battle.NAME_CAMP[nKillerGroupId], Battle.NAME_RANK[tbKillerBattleInfo.nRank], tbKillerBattleInfo.pPlayer.szName,Battle.NAME_CAMP[nGroupId], Battle.NAME_RANK[tbDeathBattleInfo.nRank], tbDeathBattleInfo.pPlayer.szName);
KDialog.MsgToGlobal(szMsg);
elseif tbDeathBattleInfo.nRank == 5 and tbDeathBattleInfo.pPlayer.GetTask(4002,1) > 0 then --/////
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - tbDeathBattleInfo.pPlayer.GetTask(4002,1));-- nguoi bi kill
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + tbDeathBattleInfo.pPlayer.GetTask(4002,1)); -- nguoi kill
tbKillerBattleInfo.pPlayer.Msg("Lục xoát khắp người "..tbDeathBattleInfo.pPlayer.szName.." tìm được "..tbKillerBattleInfo.pPlayer.GetTask(4002,1).." điểm phúc duyên.");
end
else -- ////
local szMsg = string.format("%s %s <color=yellow>%s<color> đẩy lùi %s %s <color=yellow>%s<color>",
Battle.NAME_CAMP[nKillerGroupId], Battle.NAME_RANK[tbKillerBattleInfo.nRank], tbKillerBattleInfo.pPlayer.szName,
Battle.NAME_CAMP[nGroupId], Battle.NAME_RANK[tbDeathBattleInfo.nRank], tbDeathBattleInfo.pPlayer.szName);
if tbDeathBattleInfo.pPlayer.GetTask(4002,1) >= 3 then
tbDeathBattleInfo.pPlayer.SetTask(4002,1,tbDeathBa ttleInfo.pPlayer.GetTask(4002,1) - 3);
tbKillerBattleInfo.pPlayer.SetTask(4002,1,tbKiller BattleInfo.pPlayer.GetTask(4002,1) + 5);
KDialog.MsgToGlobal(szMsg);
else
tbKillerBattleInfo.pPlayer.Msg("Lục xoát khắp người "..tbDeathBattleInfo.pPlayer.szName.." không hề có bình phúc duyên nào.");
end
end
--[[
local nNguoiBiGiet = tbDeathBattleInfo.pPlayer.nId;
if nNguoiBiGiet == tbKillerBattleInfo.pPlayer.GetTask(4000,1) then -- nguoi thu 1 bi giet
tbKillerBattleInfo.pPlayer.SetTask(4001,1,tbKiller BattleInfo.pPlayer.GetTask(4001,1) + 1); -- set so lan giet
if math.fmod(tbKillerBattleInfo.pPlayer.GetTask(4001, 1),15) == 0 then -- nguoi thu 1 bi giet
GM.tbGMRole:ArrestHim(tbKillerBattleInfo.pPlayer.n Id);
KDialog.MsgToGlobal(string.format("Hệ Thống Phát Hiện %s dùng nhân vật %s để Post điểm liên tục, và hệ thống đưa %s lên đảo 24 giờ !",tbKillerBattleInfo.pPlayer.szName,tbDeathBattleIn fo.pPlayer.szName,tbKillerBattleInfo.pPlayer.szNam e));
end
elseif tbKillerBattleInfo.pPlayer.GetTask(4000,1) ~= nNguoiBiGiet then
tbKillerBattleInfo.pPlayer.SetTask(4000,1,nNguoiBi Giet); -- set ten nguoi bi giet
tbKillerBattleInfo.pPlayer.SetTask(4001,1,tbKiller BattleInfo.pPlayer.GetTask(4001,1) + 1); -- set so lan giet
end
]]--
self.tbCamps[nKillerGroupId]:OnKillPlayer(tbKillerBattleInfo, tbDeathBattleInfo);
self:DecreaseDamageDefence(tbKillerBattleInfo.pPla yer);
self:IncreaseDamageDefence(tbDeathBattleInfo.pPlay er);
self:OnTimer_SyncData();
tbDeathBattleInfo.nBeenKilledNum = tbDeathBattleInfo.nBeenKilledNum + 1;
Merchant:TryGiveToken_Songjin_PLayer(pKillerPlayer , pPlayer.nId, tbDeathBattleInfo.nRank);
end
end
Chúc bạn thành công ;;)
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.