Dan 184 Report post Posted November 13, 2017 (edited) Is there a reason why all mobs are giving rep when killing ? This is the current script in exp_and_level.lua function GetExp_PKM( dead , atk ) local MID = GetChaID(dead) if(MID == 964 or 965 or 966 or 972 or 970)then local fame = GetChaAttr( atk , ATTR_FAME ) local famebonus = 400 fame = fame + famebonus SetCharaAttr( fame, atk , ATTR_FAME ) end Full Script function GetExp_PKM( dead , atk ) --[[player kill monster 经验值获得公式 所得exp=exp(d)/math.floor(|lv(a)-lv(b)|*0.1+1)]]-- -- LG ( "exp" , " enter getexp " ) --SystemNotice ( atk , "Entering GetExp_PKM") -- local EXP_RAID_STATE = 1 -- local StateLv = GetChaStateLv ( atk , STATE_SBJYGZ ) -- if StateLv >= 0 and StateLv <= 10 then -- EXP_RAID_STATE = StateLv + 1 -- end local dead_lv = GetChaAttrI( dead , ATTR_LV ) --获得死者的等级 local dead_exp = GetChaAttrI( dead , ATTR_CEXP ) * EXP_RAID LG("exp" , "deadlv = " , dead_lv ) LG("exp" , "dead_exp = " , dead_exp ) local k = {} local kdmg = {} local k_exp = {} k[0] , kdmg[0] = GetChaHarmByNo ( dead , 0 ) -- if ValidCha ( k[0] ) == 0 then -- SystemNotice ( atk , "damage list top queue number as null" ) -- end --SystemNotice ( atk , "Attack damage queue as number 0") --SystemNotice ( atk , "Attack Damage as"..kdmg[0]) k[1] , kdmg[1] = GetChaHarmByNo ( dead , 1 ) -- if ValidCha ( k[1] ) == 0 then -- SystemNotice ( atk , "damage list queue number 2 as null" ) -- end --SystemNotice ( atk , "damage list queue number 1") --SystemNotice ( atk , "Attack Damage as"..kdmg[1]) k[2] , kdmg[2] = GetChaHarmByNo ( dead , 2 ) -- if ValidCha ( k[2] ) == 0 then -- SystemNotice ( atk , "Damage List 3 bit as nil" ) -- end --SystemNotice ( atk , "Attack damage number 2 on list") --SystemNotice ( atk , "Attack Damage as"..kdmg[2]) k[3] , kdmg[3] = GetChaHarmByNo ( dead , 3 ) -- if ValidCha ( k[3] ) == 0 then -- SystemNotice ( atk , "damage queue number 4 as null" ) -- end --SystemNotice ( atk , "damage queue number 3") --SystemNotice ( atk , "Attack Damage as"..kdmg[3]) k[4] , kdmg[4] = GetChaHarmByNo ( dead , 4 ) -- if ValidCha ( k[4] ) == 0 then -- SystemNotice ( atk , "damage queue number 5 as null" ) -- end --SystemNotice ( atk , "attack damage queue number 4") --SystemNotice ( atk , "Attack Damage as"..kdmg[4]) local first_atker = GetFirstAtker ( dead ) local Gen_dmg = 0 for i = 0 , 4 , 1 do if k[i] ~= 0 then Gen_dmg = Gen_dmg + kdmg[i] --SystemNotice ( atk , "Attack damage index not as number 0"..i) --SystemNotice ( atk , "Attack Damage as"..kdmg[i]) end end --SystemNotice ( atk , "total attack damage as"..Gen_dmg) for i = 0 , 4 , 1 do k_exp[i] = 0 if ValidCha( k[i] )== 1 then if kdmg[i] > 0 then if k[i] == first_atker then k_exp[i] = dead_exp * ( 0.7 * kdmg[i] / Gen_dmg + 0.3 ) --第一位攻击者优先获得30%的怪物总经验 else k_exp[i] = dead_exp * 0.7 * kdmg[i] / Gen_dmg end --SystemNotice ( atk , "Attack damage queue"..i) --SystemNotice ( atk , "distributed some exp"..k_exp[i]) ShareTeamExp ( dead , k[i] , k_exp[i] ,atk ) end end end local item_host = 0 local exp_max = k_exp[0] --SystemNotice ( atk , "Item initialize possession queue"..0) for i = 1 , 4 , 1 do --SystemNotice ( atk , "Item possession determination"..i) --SystemNotice ( atk , "EXP Distribution"..k_exp[i]) if k_exp [i] > exp_max then exp_max = k_exp[i] item_host = i --SystemNotice ( atk , "Item edit belong to queue"..i) end end if ChaIsBoat (k[item_host] ) == 1 then local ship_lv = GetChaAttr ( k[item_host] , ATTR_LV ) local shipowner_lv = GetChaAttr ( TurnToCha ( k[item_host] ) , ATTR_LV ) local ship_exp = GetChaAttr ( k[item_host] , ATTR_CEXP ) local ship_expadd = math.floor ( math.min ( 7 , ( dead_lv / 10 + 2 ) ) * SHIP_EXP) local lv_limit = math.min ( ship_lv , shipowner_lv ) - 10 if dead_lv >= lv_limit then ship_exp = ship_exp + ship_expadd SetCharaAttr ( ship_exp , k[item_host] ,ATTR_CEXP ) -- SystemNotice ( k[item_host] , "Ship EXP gained: "..ship_expadd ) end end SetItemHost ( dead , k[item_host] ) local MID = GetChaID(dead) if(MID == 964 or 965 or 966 or 972 or 970)then local fame = GetChaAttr( atk , ATTR_FAME ) local famebonus = 400 fame = fame + famebonus SetCharaAttr( fame, atk , ATTR_FAME ) end end Edited November 13, 2017 by Ecstasy Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted November 13, 2017 Nevermind, solved problem, it's the "or" Quote Share this post Link to post Share on other sites
BreakThis 6 Report post Posted November 13, 2017 I think its the fame gives 400 rep per mob Quote Share this post Link to post Share on other sites
Dan 184 Report post Posted November 13, 2017 9 minutes ago, BreakThis said: I think its the fame gives 400 rep per mob This was the problem if(MID == 964 or 965 or 966 or 972 or 970)then has to be individual Quote Share this post Link to post Share on other sites