@Stinger this is the full function:
function after_player_kill_player( ATKER, DEFER )
SetCharaAttr(0, DEFER, ATTR_SP)
local map_name_ATKER = GetChaMapName ( ATKER )
local map_name_DEFER = GetChaMapName ( DEFER )
local MGPK_MapNameNum = 10
local MGPK_MapName = {}
MGPK_MapName[0] = "puzzleworld"
MGPK_MapName[1] = "puzzleworld2"
MGPK_MapName[2] = "abandonedcity"
MGPK_MapName[3] = "abandonedcity2"
MGPK_MapName[4] = "abandonedcity3"
MGPK_MapName[5] = "darkswamp"
MGPK_MapName[6] = "hell"
MGPK_MapName[7] = "hell2"
MGPK_MapName[8] = "hell3"
MGPK_MapName[9] = "hell4"
MGPK_MapName[10] = "hell5"
local ATKER_Get_Ry = 0
local DEFER_Get_Ry = 0
local ATKER_Get1_LD = 0
local DEFER_Get1_Ry = 0
if map_name_ATKER == "garner2" or map_name_DEFER == "garner2" then
local Lv_ATKER = Lv( ATKER )
local Lv_DEFER = Lv( DEFER )
local Lv_dif = Lv_ATKER - Lv_DEFER
if Lv_dif < 15 and Lv_dif > -15 then
ATKER_Get1_LD = 1
DEFER_Get1_Ry = -1
SystemNotice ( ATKER ," defeats opponent and obtain 1 Chaos point" )
SystemNotice ( DEFER ," was defeated by opponent and loses 1 Honor point")
end
if Lv_dif >= 15 then
ATKER_Get1_LD = 0
DEFER_Get1_Ry = 0
SystemNotice ( ATKER , "Defeated low level opponent. No Chaos point obtained" )
SystemNotice ( DEFER , "No honor points will be deducted when defeated by a higher level opponent." )
end
if Lv_dif <= -14 then
ATKER_Get1_LD = 2
DEFER_Get1_Ry = -2
SystemNotice ( ATKER ,"Defeated high level opponent. Obtained 2 additional Honor points" )
SystemNotice ( DEFER ,"Defeated by low level opponent. Lost 2 additional Honor points")
end
-- local RongyuTpye = ITEMATTR_VAL_STR
-- local Kill_Num = 1
-- local Kill_attr = ITEMATTR_VAL_AGI
-- local Killed_attr = ITEMATTR_VAL_DEX
local ATKER_LD = GetChaItem2 ( ATKER , 2 , 3849 )
local DEFER_RYZ1 = GetChaItem2 ( DEFER , 2 , 3849 )
local FightingPoint=GetItemAttr ( ATKER_LD , ITEMATTR_MAXENERGY)
local HonorPoint = GetItemAttr ( DEFER_RYZ1 , ITEMATTR_VAL_STR)
local FightingPoint = FightingPoint + ATKER_Get1_LD
local HonorPoint = HonorPoint + DEFER_Get1_Ry
if ATKER == DEFER then
ATKER_Get1_LD = ATKER_Get1_LD-1
end
SetItemAttr ( ATKER_LD , ITEMATTR_MAXENERGY,FightingPoint)
SetItemAttr ( DEFER_RYZ1 , ITEMATTR_VAL_STR,HonorPoint)
local atk_name = GetChaDefaultName ( ATKER )
local def_name = GetChaDefaultName ( DEFER )
local map_copy = GetChaMapCopy ( ATKER )
MapCopyNotice ( map_copy , Notice_map )
end
if map_name_ATKER == "garner2" or map_name_DEFER == "garner2" then
local atk_name = GetChaDefaultName ( ATKER )
local def_name = GetChaDefaultName ( DEFER )
local Notice_all = "["..def_name.."]#03 was raped by ["..atk_name.."]#14 inside Chaos Argent"
Notice ( Notice_all )
pkoLG('CAKill', ''..def_name..' got raped by '..atk_name..'')
GiveItem(ATKER,0,7306,1,4)
end
if map_name_ATKER == "bountypk" or map_name_DEFER == "bountypk" then
local atk_name = GetChaDefaultName ( ATKER )
local def_name = GetChaDefaultName ( DEFER )
local Notice_all = "["..def_name.."]#03 was owned by ["..atk_name.."]#14 inside Bounty PK"
Notice ( Notice_all )
pkoLG('BHKill', ''..def_name..' got raped by '..atk_name..'')
GiveItem(ATKER,0,7305,1,4)
end
if map_name_ATKER == "puzzleworld" or map_name_DEFER == "puzzleworld" then
local atk_name = GetChaDefaultName ( ATKER )
local def_name = GetChaDefaultName ( DEFER )
local Notice_all = "["..def_name.."]#03 was owned by ["..atk_name.."]#14 inside Demonic World"
Notice ( Notice_all )
pkoLG('DWKill', ''..def_name..' got raped by '..atk_name..' at DW 1')
GiveItem(ATKER,0,7235,1,4)
end
if map_name_ATKER == "puzzleworld2" or map_name_DEFER == "puzzleworld2" then
local atk_name = GetChaDefaultName ( ATKER )
local def_name = GetChaDefaultName ( DEFER )
local Notice_all = "["..def_name.."]#03 was owned by ["..atk_name.."]#14 inside Demonic World 2"
Notice ( Notice_all )
pkoLG('DWKill', ''..def_name..' got raped by '..atk_name..' at DW 2')
GiveItem(ATKER,0,7235,1,4)
end
if map_name_ATKER == "teampk" or map_name_DEFER == "teampk" then
local ATKER_RYZ = GetChaItem2 ( ATKER , 2 , 3849 )
local DEFER_RYZ = GetChaItem2 ( DEFER , 2 , 3849 )
local Lv_ATKER = Lv( ATKER )
local Lv_DEFER = Lv( DEFER )
local Lv_dif = Lv_ATKER - Lv_DEFER
if Lv_dif < 10 and Lv_dif > -5 then
ATKER_Get_Ry = 1
DEFER_Get_Ry = -1
SystemNotice ( ATKER ,"Defeat opponent and obtained Honor"..ATKER_Get_Ry )
SystemNotice ( DEFER ,"Defeat!. Honor points lost:"..ATKER_Get_Ry )
end
if Lv_dif >= 10 then
ATKER_Get_Ry = 0
DEFER_Get_Ry = 0
SystemNotice ( ATKER , "Defeated low level opponent. No Honor points obtained" )
end
if Lv_dif < -5 then
ATKER_Get_Ry = 2
DEFER_Get_Ry = -2
SystemNotice ( ATKER ,"Defeated high level opponent, obtained extra Honor reward. Received Honor points:"..ATKER_Get_Ry )
SystemNotice ( DEFER ,"Defeated by low level opponent. Extra penalty Honor lost:"..ATKER_Get_Ry )
end
local RongyuTpye = ITEMATTR_VAL_STR
local Kill_Num = 1
local Kill_attr = ITEMATTR_VAL_AGI
local Killed_attr = ITEMATTR_VAL_DEX
local atk_name = GetChaDefaultName ( ATKER )
local def_name = GetChaDefaultName ( DEFER )
local map_copy = GetChaMapCopy ( ATKER )
local Notice_map = def_name.." was defeated by "..atk_name.." Defeat"
-- SystemNotice( ATKER ,"Honor point gained")
Add_ItemAttr_RYZ ( ATKER , ATKER_RYZ , RongyuTpye , ATKER_Get_Ry )
-- SystemNotice( ATKER , "Increases Kill count by")
Add_ItemAttr_RYZ ( ATKER , ATKER_RYZ , Kill_attr , Kill_Num )
-- SystemNotice( DEFER ,"was killed. Honor points deducted by")
Add_ItemAttr_RYZ ( DEFER ,DEFER_RYZ , RongyuTpye , DEFER_Get_Ry )
-- SystemNotice( DEFER , "Defeat Count increases by")
Add_ItemAttr_RYZ ( DEFER ,DEFER_RYZ , Killed_attr , Kill_Num )
MapCopyNotice ( map_copy , Notice_map )
end
if map_name_ATKER == "secretgarden" or map_name_DEFER == "secretgarden" then
local atk_name = GetChaDefaultName ( ATKER )
local def_name = GetChaDefaultName ( DEFER )
local Notice_all = "["..def_name.."] was defeated by ["..atk_name.."]"
Notice ( Notice_all )
end
if map_name_ATKER == "guildwar" or map_name_DEFER == "guildwar" then
local ATKER = TurnToCha ( ATKER )
local DEFER = TurnToCha ( DEFER )
--local Cha = TurnToCha(role)
local Num_shengsi_1= CheckBagItem(DEFER,2382)
--Notice("Num_shengsi"..Num_shengsi)
if Num_shengsi_1 >=1 then
TakeItem( DEFER, 0,2382, 1 )
GiveItem ( ATKER , 0 , 2383 , 1 , 4 )
else
if GetChaGuildID(DEFER) <= 100 and GetChaGuildID(DEFER) > 0 then
GiveItem ( ATKER , 0 , 2858 , 1 , 4 )
end
if GetChaGuildID(DEFER) > 100 and GetChaGuildID(DEFER) <= 200 then
GiveItem ( ATKER , 0 , 2859 , 1 , 4 )
end
if GetChaGuildID(DEFER) == 0 then
SystemNotice ( ATKER , "Target does not belong to Navy nor Pirates, you did not manage to find anything!" )
end
end
end
if map_name_ATKER == "guildwar2" or map_name_DEFER == "guildwar2" then
local ATKER = TurnToCha ( ATKER )
local DEFER = TurnToCha ( DEFER )
--local Cha = TurnToCha(role)
local Num_shengsi_2= CheckBagItem(DEFER,2382)
--Notice("Num_shengsi"..Num_shengsi)
if Num_shengsi_2 >=1 then
TakeItem( DEFER, 0,2382, 1 )
GiveItem ( ATKER , 0 , 2383 , 1 , 4 )
else
if GetChaGuildID(DEFER) <= 100 and GetChaGuildID(DEFER) > 0 then
GiveItem ( ATKER , 0 , 2858 , 1 , 4 )
end
if GetChaGuildID(DEFER) > 100 and GetChaGuildID(DEFER) <= 200 then
GiveItem ( ATKER , 0 , 2859 , 1 , 4 )
end
if GetChaGuildID(DEFER) == 0 then
SystemNotice ( ATKER , "Target does not belong to Navy nor Pirates, you did not manage to find anything!" )
end
end
end
local C_Map = 0
for C_Map = 0 , MGPK_MapNameNum , 1 do
if map_name_ATKER == MGPK_MapName[C_Map] then
local atk_name = GetChaDefaultName ( ATKER )
local def_name = GetChaDefaultName ( DEFER )
local map_copy = GetChaMapCopy ( ATKER )
local Notice_map = def_name.." was defeated by "..atk_name.." Defeat"
MapCopyNotice ( map_copy , Notice_map )
ATKER = TurnToCha ( ATKER )
DEFER = TurnToCha ( DEFER )
local Have_TSWW = CheckBagItem( DEFER , 3846 )
if Have_TSWW <= 0 then
Dead_Punish_ItemURE ( DEFER )
MGPK_Dead_Punish_Exp ( DEFER )
else
local j = DelBagItem( DEFER , 3846 , 1 )
if j == 0 then
LG ( "NewItem" , "Voodoo Doll deletion failed" )
else
SystemNotice ( DEFER , "Voodoo Doll replace death penalty" )
end
end
end
end
-- PK_Dead_Punish_ItemURE ( DEFER )
end