moshen_BGS = 0 -- Состояние экипировки Мошэнь BGS moshen_BGS_Data = 0 -- Запись изменений экипировки Мошэнь -- Функции экипировки function x_RoleFAbaoLevelup(MapID, InstanceID, RoleID, FabaoID, Type, FBVal) if Type == 0 then local Trail = {2004,3004,4003,5003,6004,7003,8006,9011} if role.GetTrialCompleteNum(RoleID,2004) < 100 then for i = 1,8 do if role.GetTrialCompleteNum(RoleID,Trail[i]) < FBVal then role.SetTrialCompleteNum(RoleID, Trail[i], FBVal) end if role.GetTrialState(RoleID, Trail[i]) == 1 and role.GetTrialCompleteNum(RoleID,Trail[i]) >= Trail_maxnum[Trail[i]] then role.TrialComplete(RoleID,Trail[i]) end end end if FBVal%10 == 0 and FBVal >19 then role.NotifyFBBS(RoleID,4,FBVal) end -- Логика обработки уровней экипировки if role.IsRoleHaveQuest(MapID, InstanceID, RoleID, 40003) then if FBVal >= 10 then role.ModSpecialTargetValue(MapID, InstanceID, RoleID, 40003, 2) end end if role.IsRoleHaveQuest(MapID, InstanceID, RoleID, 40005) then if FBVal >= 20 then role.ModSpecialTargetValue(MapID, InstanceID, RoleID, 40005, 2) end end if role.IsRoleHaveQuest(MapID, InstanceID, RoleID, 40006) then if FBVal >= 30 then role.ModSpecialTargetValue(MapID, InstanceID, RoleID, 40006, 2) end end if role.IsRoleHaveQuest(MapID, InstanceID, RoleID, 40007) then if FBVal >= 40 then role.ModSpecialTargetValue(MapID, InstanceID, RoleID, 40007, 2) end end if role.IsRoleHaveQuest(MapID, InstanceID, RoleID, 40008) then if FBVal >= 50 then role.ModSpecialTargetValue(MapID, InstanceID, RoleID, 40008, 2) end end if role.IsRoleHaveQuest(MapID, InstanceID, RoleID, 40009) then if FBVal >= 60 then role.ModSpecialTargetValue(MapID, InstanceID, RoleID, 40009, 2) end end --[[elseif Type == 1 or Type == 2 then local k = role.GetRoleScriptData(RoleID, 1, RoleDataType["FaBaoShiLian"]) if k < 10 then role.SetRoleScriptData(RoleID, 1, RoleDataType["FaBaoShiLian"], 10 + k) end]] end end function x_RoleLianQi(MapID, InstanceID, RoleID, ItemID, level) if role.GetTrialState(RoleID, 8007) == 1 then role.SetTrialCompleteNum(RoleID, 8007, 1) end if role.GetTrialState(RoleID, 8007) == 1 and role.GetTrialCompleteNum(RoleID,8007) >= Trail_maxnum[8007] then role.TrialComplete(RoleID,8007) end end function x_OnEquipConsolidateLevelUp(MapID, InstanceID, RoleID, TypeID, LevelBefore, LevelNow) if LevelNow > LevelBefore then local lv = {5,8,12,14,20} for i = 1,5 do if LevelNow == lv[i] then role.NotifyFBBS(RoleID,7,LevelNow) end end local Trail = {3006,4004,5004,6005,7004,8008,9012,9013} for i = 1,8 do if role.GetTrialCompleteNum(RoleID,Trail[i]) < LevelNow and role.GetTrialState(RoleID, Trail[i]) == 1 then role.SetTrialCompleteNum(RoleID, Trail[i], LevelNow) end if role.GetTrialState(RoleID, Trail[i]) == 1 and role.GetTrialCompleteNum(RoleID,Trail[i]) >= Trail_maxnum[Trail[i]] then role.TrialComplete(RoleID,Trail[i]) end end end end function x_OnEquipDigHole(MapID, InstanceID, RoleID, TypeID, Sucess, SlotNum) if Sucess == 1 then local Trail = {4005,5005,6006,7005,8034,9042} for i = 1,6 do if role.GetTrialCompleteNum(RoleID,Trail[i]) < SlotNum and role.GetTrialState(RoleID, Trail[i]) >= 1 then role.SetTrialCompleteNum(RoleID, Trail[i], SlotNum) end if role.GetTrialState(RoleID, Trail[i]) == 1 and role.GetTrialCompleteNum(RoleID,Trail[i]) >= Trail_maxnum[Trail[i]] then role.TrialComplete(RoleID,Trail[i]) end end end end function x_OnProduceEquip(MapID, InstanceID, RoleID, TypeID, Quality) if Quality >= 3 then if role.GetTrialCompleteNum(RoleID,3012) < 1 and role.GetTrialState(RoleID, 3012) >= 1 then role.SetTrialCompleteNum(RoleID, 3012, 1) end if role.GetTrialState(RoleID, 3012) == 1 and role.GetTrialCompleteNum(RoleID,3012) >= Trail_maxnum[3012] then role.TrialComplete(RoleID,3012) end end end function x_OnCutStone(MapID, InstanceID, RoleID, DianJinID, TypeID, NewStoneTypeID) -- Синтез камней local Item_ID = {} Item_ID[3030001] = {ID = {3050084},Percent = {100},num = {1}} Item_ID[3030002] = {ID = {3030001,3050085,3050084},Percent = {100,5,100},num = {1,1,2}} Item_ID[3030003] = {ID = {3030002,3050085,3050084},Percent = {100,10,100},num = {1,1,3}} Item_ID[3030004] = {ID = {3030003,3050085,3050084},Percent = {100,15,100},num = {1,1,4}} Item_ID[3030009] = {ID = {3050084},Percent = {100},num ={1}} Item_ID[3030010] = {ID = {3030009,3050085,3050084},Percent = {100,5,100},num = {1,1,2}} Item_ID[3030011] = {ID = {3030010,3050085,3050084},Percent = {100,10,100},num = {1,1,3}} Item_ID[3030012] = {ID = {3030011,3050085,3050084},Percent = {100,15,100},num = {1,1,4}} Item_ID[3030017] = {ID = {3050084},Percent = {100},num = {3}} Item_ID[3030018] = {ID = {3030017,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030023] = {ID = {3050084,3050085},Percent = {100,20},num = {1,3}} Item_ID[3030024] = {ID = {3030023,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030029] = {ID = {3050084},Percent = {100},num = {1}} Item_ID[3030030] = {ID = {3030029,3050085,3050084},Percent = {100,5,100},num = {1,1,2}} Item_ID[3030031] = {ID = {3030030,3050085,3050084},Percent = {100,10,100},num = {1,1,3}} Item_ID[3030032] = {ID = {3030031,3050085,3050084},Percent = {100,15,100},num = {1,1,4}} Item_ID[3030037] = {ID = {3050084},Percent = {100},num = {1}} Item_ID[3030038] = {ID = {3030037,3050085,3050084},Percent = {100,5,100},num = {1,1,2}} Item_ID[3030039] = {ID = {3030038,3050085,3050084},Percent = {100,10,100},num = {1,1,3}} Item_ID[3030040] = {ID = {3030039,3050085,3050084},Percent = {100,15,100},num = {1,1,4}} Item_ID[3030045] = {ID = {3050084,3050085},Percent = {100,20},num = {3,1}} Item_ID[3030046] = {ID = {3030045,3050084,3050085},Percent = {100,100,20},num = {1,4,1}} Item_ID[3030051] = {ID = {3050084,3050085},Percent = {100,20},num = {3,1}} Item_ID[3030052] = {ID = {3030051,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030057] = {ID = {3050084,3050085},Percent = {100,20},num = {4,1}} Item_ID[3030062] = {ID = {3050084,3050085},Percent = {100,20},num = {4,1}} Item_ID[3030067] = {ID = {3050084,3050085},Percent = {100,20},num = {4,1}} Item_ID[3030072] = {ID = {3050084},Percent = {100},num = {1}} Item_ID[3030073] = {ID = {3030072,3050085,3050084},Percent = {100,5,100},num = {1,1,2}} Item_ID[3030074] = {ID = {3030073,3050085,3050084},Percent = {100,10,100},num = {1,1,3}} Item_ID[3030075] = {ID = {3030074,3050085,3050084},Percent = {100,15,100},num = {1,1,4}} Item_ID[3030080] = {ID = {3050084},Percent = {100},num = {1}} Item_ID[3030081] = {ID = {3030080,3050085,3050084},Percent = {100,5,100},num = {1,1,2}} Item_ID[3030082] = {ID = {3030081,3050085,3050084},Percent = {100,10,100},num = {1,1,3}} Item_ID[3030083] = {ID = {3030082,3050085,3050084},Percent = {100,15,100},num = {1,1,4}} Item_ID[3030088] = {ID = {3050084,3050085},Percent = {100,20},num = {4,1}} Item_ID[3030093] = {ID = {3050084,3050085},Percent = {100,20},num = {3,1}} Item_ID[3030094] = {ID = {3030093,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030096] = {ID = {3050084,3050085},Percent = {100,20},num = {3,1}} Item_ID[3030097] = {ID = {3030096,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030099] = {ID = {3050084,3050085},Percent = {100,20},num = {3,1}} Item_ID[3030100] = {ID = {3030099,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030111] = {ID = {3050084},Percent = {100},num = {1}} Item_ID[3030005] = {ID = {3030004,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030006] = {ID = {3030005,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030007] = {ID = {3030006,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030008] = {ID = {3030007,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030013] = {ID = {3030012,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030014] = {ID = {3030013,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030015] = {ID = {3030014,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030016] = {ID = {3030015,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030019] = {ID = {3030018,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030020] = {ID = {3030019,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030021] = {ID = {3030020,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030022] = {ID = {3030021,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030025] = {ID = {3030024,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030026] = {ID = {3030025,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030027] = {ID = {3030026,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030028] = {ID = {3030027,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030033] = {ID = {3030032,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030034] = {ID = {3030033,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030035] = {ID = {3030034,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030036] = {ID = {3030035,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030041] = {ID = {3030040,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030042] = {ID = {3030041,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030043] = {ID = {3030042,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030044] = {ID = {3030043,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030047] = {ID = {3030046,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030048] = {ID = {3030047,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030049] = {ID = {3030048,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030050] = {ID = {3030049,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030053] = {ID = {3030052,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030054] = {ID = {3030053,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030055] = {ID = {3030054,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030056] = {ID = {3030055,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030058] = {ID = {3030057,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030059] = {ID = {3030058,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030060] = {ID = {3030059,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030061] = {ID = {3030060,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030063] = {ID = {3030062,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030064] = {ID = {3030063,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030065] = {ID = {3030064,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030066] = {ID = {3030065,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030068] = {ID = {3030067,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030069] = {ID = {3030068,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030070] = {ID = {3030069,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030071] = {ID = {3030070,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030076] = {ID = {3030075,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030077] = {ID = {3030076,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030078] = {ID = {3030077,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030079] = {ID = {3030078,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030084] = {ID = {3030083,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030085] = {ID = {3030084,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030086] = {ID = {3030085,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030087] = {ID = {3030086,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030089] = {ID = {3030088,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030090] = {ID = {3030089,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030091] = {ID = {3030090,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030092] = {ID = {3030091,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030095] = {ID = {3030094,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030098] = {ID = {3030097,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030101] = {ID = {3030100,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030154] = {ID = {3030008,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030155] = {ID = {3030016,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030156] = {ID = {3030022,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030157] = {ID = {3030028,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030158] = {ID = {3030036,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030159] = {ID = {3030044,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030160] = {ID = {3030050,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030164] = {ID = {3030071,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030165] = {ID = {3030079,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030166] = {ID = {3030087,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030167] = {ID = {3030092,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030161] = {ID = {3030056,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030162] = {ID = {3030061,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030163] = {ID = {3030066,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[5802168] = {ID = {3030154,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802240] = {ID = {3030155,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802292] = {ID = {3030156,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802298] = {ID = {3030157,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802304] = {ID = {3030158,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802326] = {ID = {3030159,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802348] = {ID = {3030160,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802444] = {ID = {3030164,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802463] = {ID = {3030165,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802528] = {ID = {3030166,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802540] = {ID = {3030167,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802390] = {ID = {3030161,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802432] = {ID = {3030162,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802438] = {ID = {3030163,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802181] = {ID = {3030468,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802169] = {ID = {5802168,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802241] = {ID = {5802240,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802293] = {ID = {5802292,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802299] = {ID = {5802298,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802305] = {ID = {5802304,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802327] = {ID = {5802326,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802349] = {ID = {5802348,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802445] = {ID = {5802444,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802464] = {ID = {5802463,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802529] = {ID = {5802528,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802541] = {ID = {5802540,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802391] = {ID = {5802390,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802433] = {ID = {5802432,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802439] = {ID = {5802438,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802182] = {ID = {5802181,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[3030435] = {ID = {3030426,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030475] = {ID = {3030474,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030482] = {ID = {3030481,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030489] = {ID = {3030488,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030468] = {ID = {3030467,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[3030426] = {ID = {3030425,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030474] = {ID = {3030473,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030481] = {ID = {3030480,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030488] = {ID = {3030487,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030467] = {ID = {3030466,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[3030473] = {ID = {3030472,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030480] = {ID = {3030479,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030487] = {ID = {3030486,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030466] = {ID = {3030465,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[3030472] = {ID = {3030471,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030479] = {ID = {3030478,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030486] = {ID = {3030485,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030465] = {ID = {3030464,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[3030471] = {ID = {3030470,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030478] = {ID = {3030477,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030485] = {ID = {3030484,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030464] = {ID = {3030463,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[3030470] = {ID = {3030469,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030477] = {ID = {3030476,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030484] = {ID = {3030483,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[3030463] = {ID = {3030462,3050085,3050084},Percent = {100,20,100},num = {1,1,4}} Item_ID[5802460] = {ID = {3030435,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802461] = {ID = {5802460,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802323] = {ID = {3030475,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802324] = {ID = {5802323,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802454] = {ID = {3030482,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802455] = {ID = {5802454,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802259] = {ID = {3030489,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[5802260] = {ID = {5802259,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[6600997] = {ID = {6600996,3050085,3050084},Percent = {100,20,100},num = {1,1,5}} Item_ID[6600998] = {ID = {6600997,3050085,3050084},Percent = {100,20,100},num = {1,1,6}} Item_ID[6600999] = {ID = {6600998,3050085,3050084},Percent = {100,20,100},num = {1,1,7}} Item_ID[6601000] = {ID = {6600999,3050085,3050084},Percent = {100,20,100},num = {1,1,8}} Item_ID[6601001] = {ID = {6601000,3050085,3050084},Percent = {100,20,100},num = {1,1,9}} Item_ID[6601002] = {ID = {6601001,3050085,3050084},Percent = {100,20,100},num = {1,1,10}} Item_ID[6601003] = {ID = {6601002,3050085,3050084},Percent = {100,20,100},num = {1,1,11}} Item_ID[5802170] = {ID = {5802169,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802242] = {ID = {5802241,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802294] = {ID = {5802293,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802300] = {ID = {5802299,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802306] = {ID = {5802305,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802328] = {ID = {5802327,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802350] = {ID = {5802349,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802446] = {ID = {5802445,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802465] = {ID = {5802464,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802530] = {ID = {5802529,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802542] = {ID = {5802541,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802392] = {ID = {5802391,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802434] = {ID = {5802433,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802440] = {ID = {5802439,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802183] = {ID = {5802182,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802462] = {ID = {5802461,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802325] = {ID = {5802324,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802456] = {ID = {5802455,3050085,3050084},Percent = {100,20,100},num = {1,1,12}} Item_ID[5802261] = {ID = {3050085,3050084},Percent = {20,100},num = {1,12}} Item_ID[6601004] = {ID = {6601003,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601872] = {ID = {5802170,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601873] = {ID = {5802242,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601882] = {ID = {5802294,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601883] = {ID = {5802300,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601875] = {ID = {5802306,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601876] = {ID = {5802328,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601880] = {ID = {5802350,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601878] = {ID = {5802446,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601871] = {ID = {5802465,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601874] = {ID = {5802530,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601879] = {ID = {5802542,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601881] = {ID = {5802392,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601884] = {ID = {5802434,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601885] = {ID = {5802440,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601889] = {ID = {5802183,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601877] = {ID = {5802462,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601886] = {ID = {5802325,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601887] = {ID = {5802456,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601888] = {ID = {5802261,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} Item_ID[6601890] = {ID = {6601004,3050085,3050084},Percent = {100,20,100},num = {1,1,13}} local StoneLevel2 = {} StoneLevel2[1] = 3040027 StoneLevel2[2] = 3040032 StoneLevel2[3] = 3040037 StoneLevel2[4] = 3040042 StoneLevel2[5] = 3040002 StoneLevel2[6] = 3040007 StoneLevel2[7] = 3040012 StoneLevel2[8] = 3040017 local StoneLevel3 = {} StoneLevel3[1] = 3040028 StoneLevel3[2] = 3040033 StoneLevel3[3] = 3040038 StoneLevel3[4] = 3040043 StoneLevel3[5] = 3040003 StoneLevel3[6] = 3040008 StoneLevel3[7] = 3040013 StoneLevel3[8] = 3040018 local StoneLevel4 = {} StoneLevel4[1] = 3040029 StoneLevel4[2] = 3040034 StoneLevel4[3] = 3040039 StoneLevel4[4] = 3040044 StoneLevel4[5] = 3040004 StoneLevel4[6] = 3040009 StoneLevel4[7] = 3040014 StoneLevel4[8] = 3040019 local StoneLevel5 = {} StoneLevel5[1] = 3040030 StoneLevel5[2] = 3040035 StoneLevel5[3] = 3040040 StoneLevel5[4] = 3040045 StoneLevel5[5] = 3040005 StoneLevel5[6] = 3040010 StoneLevel5[7] = 3040015 StoneLevel5[8] = 3040020 local StoneLevel6 = {} StoneLevel6[1] = 5802634 StoneLevel6[2] = 5802639 StoneLevel6[3] = 5802644 StoneLevel6[4] = 5802649 StoneLevel6[5] = 5802609 StoneLevel6[6] = 5802614 StoneLevel6[7] = 5802619 StoneLevel6[8] = 5802624 local StoneLevel7 = {} StoneLevel7[1] = 5802635 StoneLevel7[2] = 5802640 StoneLevel7[3] = 5802645 StoneLevel7[4] = 5802650 StoneLevel7[5] = 5802610 StoneLevel7[6] = 5802615 StoneLevel7[7] = 5802620 StoneLevel7[8] = 5802625 local called = false for i in pairs(StoneLevel2) do if not called and (TypeID == StoneLevel2[i]) then role.AddRoleItem(MapID, InstanceID, RoleID, NewStoneTypeID, 2, 6, 8, 420) called = true -- Достижения камней 2 ур. - проверка при создании камней уровня 2 if NewStoneTypeID == 3030002 then local trial1016_state = role.GetTrialState(RoleID, 1016) if trial1016_state == 0 then role.OpenTrain(RoleID, 1016) trial1016_state = role.GetTrialState(RoleID, 1016) end if trial1016_state == 1 then if role.GetTrialCompleteNum(RoleID, 1016) < 1 then role.SetTrialCompleteNum(RoleID, 1016, 1) end if role.GetTrialCompleteNum(RoleID, 1016) >= Trail_maxnum[1016] then role.TrialComplete(RoleID, 1016) end end elseif NewStoneTypeID == 3030010 then local trial1017_state = role.GetTrialState(RoleID, 1017) if trial1017_state == 0 then role.OpenTrain(RoleID, 1017) trial1017_state = role.GetTrialState(RoleID, 1017) end if trial1017_state == 1 then if role.GetTrialCompleteNum(RoleID, 1017) < 1 then role.SetTrialCompleteNum(RoleID, 1017, 1) end if role.GetTrialCompleteNum(RoleID, 1017) >= Trail_maxnum[1017] then role.TrialComplete(RoleID, 1017) end end elseif NewStoneTypeID == 3030030 then local trial1018_state = role.GetTrialState(RoleID, 1018) if trial1018_state == 0 then role.OpenTrain(RoleID, 1018) trial1018_state = role.GetTrialState(RoleID, 1018) end if trial1018_state == 1 then if role.GetTrialCompleteNum(RoleID, 1018) < 1 then role.SetTrialCompleteNum(RoleID, 1018, 1) end if role.GetTrialCompleteNum(RoleID, 1018) >= Trail_maxnum[1018] then role.TrialComplete(RoleID, 1018) end end elseif NewStoneTypeID == 3030038 then local trial1019_state = role.GetTrialState(RoleID, 1019) if trial1019_state == 0 then role.OpenTrain(RoleID, 1019) trial1019_state = role.GetTrialState(RoleID, 1019) end if trial1019_state == 1 then if role.GetTrialCompleteNum(RoleID, 1019) < 1 then role.SetTrialCompleteNum(RoleID, 1019, 1) end if role.GetTrialCompleteNum(RoleID, 1019) >= Trail_maxnum[1019] then role.TrialComplete(RoleID, 1019) end end elseif NewStoneTypeID == 3030073 then local trial1020_state = role.GetTrialState(RoleID, 1020) if trial1020_state == 0 then role.OpenTrain(RoleID, 1020) trial1020_state = role.GetTrialState(RoleID, 1020) end if trial1020_state == 1 then if role.GetTrialCompleteNum(RoleID, 1020) < 1 then role.SetTrialCompleteNum(RoleID, 1020, 1) end if role.GetTrialCompleteNum(RoleID, 1020) >= Trail_maxnum[1020] then role.TrialComplete(RoleID, 1020) end end elseif NewStoneTypeID == 3030081 then local trial1021_state = role.GetTrialState(RoleID, 1021) if trial1021_state == 0 then role.OpenTrain(RoleID, 1021) trial1021_state = role.GetTrialState(RoleID, 1021) end if trial1021_state == 1 then if role.GetTrialCompleteNum(RoleID, 1021) < 1 then role.SetTrialCompleteNum(RoleID, 1021, 1) end if role.GetTrialCompleteNum(RoleID, 1021) >= Trail_maxnum[1021] then role.TrialComplete(RoleID, 1021) end end end return 0 end end for i in pairs(StoneLevel3) do if not called and (TypeID == StoneLevel3[i]) then role.AddRoleItem(MapID, InstanceID, RoleID, NewStoneTypeID, 3, 6, 8, 420) called = true -- Достижения камней 3 ур. - проверка при создании камней уровня 3 if NewStoneTypeID == 3030003 then local trial3019_state = role.GetTrialState(RoleID, 3019) if trial3019_state == 0 then role.OpenTrain(RoleID, 3019) trial3019_state = role.GetTrialState(RoleID, 3019) end if trial3019_state == 1 then if role.GetTrialCompleteNum(RoleID, 3019) < 1 then role.SetTrialCompleteNum(RoleID, 3019, 1) end if role.GetTrialCompleteNum(RoleID, 3019) >= Trail_maxnum[3019] then role.TrialComplete(RoleID, 3019) end end elseif NewStoneTypeID == 3030011 then local trial3020_state = role.GetTrialState(RoleID, 3020) if trial3020_state == 0 then role.OpenTrain(RoleID, 3020) trial3020_state = role.GetTrialState(RoleID, 3020) end if trial3020_state == 1 then if role.GetTrialCompleteNum(RoleID, 3020) < 1 then role.SetTrialCompleteNum(RoleID, 3020, 1) end if role.GetTrialCompleteNum(RoleID, 3020) >= Trail_maxnum[3020] then role.TrialComplete(RoleID, 3020) end end elseif NewStoneTypeID == 3030031 then local trial3021_state = role.GetTrialState(RoleID, 3021) if trial3021_state == 0 then role.OpenTrain(RoleID, 3021) trial3021_state = role.GetTrialState(RoleID, 3021) end if trial3021_state == 1 then if role.GetTrialCompleteNum(RoleID, 3021) < 1 then role.SetTrialCompleteNum(RoleID, 3021, 1) end if role.GetTrialCompleteNum(RoleID, 3021) >= Trail_maxnum[3021] then role.TrialComplete(RoleID, 3021) end end elseif NewStoneTypeID == 3030039 then local trial3022_state = role.GetTrialState(RoleID, 3022) if trial3022_state == 0 then role.OpenTrain(RoleID, 3022) trial3022_state = role.GetTrialState(RoleID, 3022) end if trial3022_state == 1 then if role.GetTrialCompleteNum(RoleID, 3022) < 1 then role.SetTrialCompleteNum(RoleID, 3022, 1) end if role.GetTrialCompleteNum(RoleID, 3022) >= Trail_maxnum[3022] then role.TrialComplete(RoleID, 3022) end end elseif NewStoneTypeID == 3030074 then local trial3023_state = role.GetTrialState(RoleID, 3023) if trial3023_state == 0 then role.OpenTrain(RoleID, 3023) trial3023_state = role.GetTrialState(RoleID, 3023) end if trial3023_state == 1 then if role.GetTrialCompleteNum(RoleID, 3023) < 1 then role.SetTrialCompleteNum(RoleID, 3023, 1) end if role.GetTrialCompleteNum(RoleID, 3023) >= Trail_maxnum[3023] then role.TrialComplete(RoleID, 3023) end end elseif NewStoneTypeID == 3030082 then local trial3024_state = role.GetTrialState(RoleID, 3024) if trial3024_state == 0 then role.OpenTrain(RoleID, 3024) trial3024_state = role.GetTrialState(RoleID, 3024) end if trial3024_state == 1 then if role.GetTrialCompleteNum(RoleID, 3024) < 1 then role.SetTrialCompleteNum(RoleID, 3024, 1) end if role.GetTrialCompleteNum(RoleID, 3024) >= Trail_maxnum[3024] then role.TrialComplete(RoleID, 3024) end end end return 0 end end for i in pairs(StoneLevel4) do if not called and (TypeID == StoneLevel4[i]) then role.AddRoleItem(MapID, InstanceID, RoleID, NewStoneTypeID, 4, 6, 8, 420) called = true -- Достижения камней 4 ур. - проверка при создании камней уровня 4 if NewStoneTypeID == 3030004 then local trial5024_state = role.GetTrialState(RoleID, 5024) if trial5024_state == 0 then role.OpenTrain(RoleID, 5024) trial5024_state = role.GetTrialState(RoleID, 5024) end if trial5024_state == 1 then if role.GetTrialCompleteNum(RoleID, 5024) < 1 then role.SetTrialCompleteNum(RoleID, 5024, 1) end if role.GetTrialCompleteNum(RoleID, 5024) >= Trail_maxnum[5024] then role.TrialComplete(RoleID, 5024) end end elseif NewStoneTypeID == 3030012 then local trial5025_state = role.GetTrialState(RoleID, 5025) if trial5025_state == 0 then role.OpenTrain(RoleID, 5025) trial5025_state = role.GetTrialState(RoleID, 5025) end if trial5025_state == 1 then if role.GetTrialCompleteNum(RoleID, 5025) < 1 then role.SetTrialCompleteNum(RoleID, 5025, 1) end if role.GetTrialCompleteNum(RoleID, 5025) >= Trail_maxnum[5025] then role.TrialComplete(RoleID, 5025) end end elseif NewStoneTypeID == 3030032 then local trial5026_state = role.GetTrialState(RoleID, 5026) if trial5026_state == 0 then role.OpenTrain(RoleID, 5026) trial5026_state = role.GetTrialState(RoleID, 5026) end if trial5026_state == 1 then if role.GetTrialCompleteNum(RoleID, 5026) < 1 then role.SetTrialCompleteNum(RoleID, 5026, 1) end if role.GetTrialCompleteNum(RoleID, 5026) >= Trail_maxnum[5026] then role.TrialComplete(RoleID, 5026) end end elseif NewStoneTypeID == 3030040 then local trial5027_state = role.GetTrialState(RoleID, 5027) if trial5027_state == 0 then role.OpenTrain(RoleID, 5027) trial5027_state = role.GetTrialState(RoleID, 5027) end if trial5027_state == 1 then if role.GetTrialCompleteNum(RoleID, 5027) < 1 then role.SetTrialCompleteNum(RoleID, 5027, 1) end if role.GetTrialCompleteNum(RoleID, 5027) >= Trail_maxnum[5027] then role.TrialComplete(RoleID, 5027) end end elseif NewStoneTypeID == 3030075 then local trial5028_state = role.GetTrialState(RoleID, 5028) if trial5028_state == 0 then role.OpenTrain(RoleID, 5028) trial5028_state = role.GetTrialState(RoleID, 5028) end if trial5028_state == 1 then if role.GetTrialCompleteNum(RoleID, 5028) < 1 then role.SetTrialCompleteNum(RoleID, 5028, 1) end if role.GetTrialCompleteNum(RoleID, 5028) >= Trail_maxnum[5028] then role.TrialComplete(RoleID, 5028) end end elseif NewStoneTypeID == 3030083 then local trial5029_state = role.GetTrialState(RoleID, 5029) if trial5029_state == 0 then role.OpenTrain(RoleID, 5029) trial5029_state = role.GetTrialState(RoleID, 5029) end if trial5029_state == 1 then if role.GetTrialCompleteNum(RoleID, 5029) < 1 then role.SetTrialCompleteNum(RoleID, 5029, 1) end if role.GetTrialCompleteNum(RoleID, 5029) >= Trail_maxnum[5029] then role.TrialComplete(RoleID, 5029) end end end return 0 end end for i in pairs(StoneLevel5) do if not called and (TypeID == StoneLevel5[i]) then role.AddRoleItem(MapID, InstanceID, RoleID, NewStoneTypeID, 5, 6, 8, 420) called = true -- Достижения камней 5 ур. - проверка при создании камней уровня 5 if NewStoneTypeID == 3030005 then local trial6034_state = role.GetTrialState(RoleID, 6034) if trial6034_state == 0 then role.OpenTrain(RoleID, 6034) trial6034_state = role.GetTrialState(RoleID, 6034) end if trial6034_state == 1 then if role.GetTrialCompleteNum(RoleID, 6034) < 1 then role.SetTrialCompleteNum(RoleID, 6034, 1) end if role.GetTrialCompleteNum(RoleID, 6034) >= Trail_maxnum[6034] then role.TrialComplete(RoleID, 6034) end end elseif NewStoneTypeID == 3030013 then local trial6035_state = role.GetTrialState(RoleID, 6035) if trial6035_state == 0 then role.OpenTrain(RoleID, 6035) trial6035_state = role.GetTrialState(RoleID, 6035) end if trial6035_state == 1 then if role.GetTrialCompleteNum(RoleID, 6035) < 1 then role.SetTrialCompleteNum(RoleID, 6035, 1) end if role.GetTrialCompleteNum(RoleID, 6035) >= Trail_maxnum[6035] then role.TrialComplete(RoleID, 6035) end end elseif NewStoneTypeID == 3030033 then local trial6036_state = role.GetTrialState(RoleID, 6036) if trial6036_state == 0 then role.OpenTrain(RoleID, 6036) trial6036_state = role.GetTrialState(RoleID, 6036) end if trial6036_state == 1 then if role.GetTrialCompleteNum(RoleID, 6036) < 1 then role.SetTrialCompleteNum(RoleID, 6036, 1) end if role.GetTrialCompleteNum(RoleID, 6036) >= Trail_maxnum[6036] then role.TrialComplete(RoleID, 6036) end end elseif NewStoneTypeID == 3030041 then local trial6037_state = role.GetTrialState(RoleID, 6037) if trial6037_state == 0 then role.OpenTrain(RoleID, 6037) trial6037_state = role.GetTrialState(RoleID, 6037) end if trial6037_state == 1 then if role.GetTrialCompleteNum(RoleID, 6037) < 1 then role.SetTrialCompleteNum(RoleID, 6037, 1) end if role.GetTrialCompleteNum(RoleID, 6037) >= Trail_maxnum[6037] then role.TrialComplete(RoleID, 6037) end end elseif NewStoneTypeID == 3030076 then local trial6038_state = role.GetTrialState(RoleID, 6038) if trial6038_state == 0 then role.OpenTrain(RoleID, 6038) trial6038_state = role.GetTrialState(RoleID, 6038) end if trial6038_state == 1 then if role.GetTrialCompleteNum(RoleID, 6038) < 1 then role.SetTrialCompleteNum(RoleID, 6038, 1) end if role.GetTrialCompleteNum(RoleID, 6038) >= Trail_maxnum[6038] then role.TrialComplete(RoleID, 6038) end end elseif NewStoneTypeID == 3030084 then local trial6039_state = role.GetTrialState(RoleID, 6039) if trial6039_state == 0 then role.OpenTrain(RoleID, 6039) trial6039_state = role.GetTrialState(RoleID, 6039) end if trial6039_state == 1 then if role.GetTrialCompleteNum(RoleID, 6039) < 1 then role.SetTrialCompleteNum(RoleID, 6039, 1) end if role.GetTrialCompleteNum(RoleID, 6039) >= Trail_maxnum[6039] then role.TrialComplete(RoleID, 6039) end end end return 0 end end for i in pairs(StoneLevel6) do if not called and (TypeID == StoneLevel6[i]) then role.AddRoleItem(MapID, InstanceID, RoleID, NewStoneTypeID, 6, 6, 8, 420) called = true -- Достижения камней 6 ур. - проверка при создании камней уровня 6 if NewStoneTypeID == 3030006 then local trial7032_state = role.GetTrialState(RoleID, 7032) if trial7032_state == 0 then role.OpenTrain(RoleID, 7032) trial7032_state = role.GetTrialState(RoleID, 7032) end if trial7032_state == 1 then if role.GetTrialCompleteNum(RoleID, 7032) < 1 then role.SetTrialCompleteNum(RoleID, 7032, 1) end if role.GetTrialCompleteNum(RoleID, 7032) >= Trail_maxnum[7032] then role.TrialComplete(RoleID, 7032) end end elseif NewStoneTypeID == 3030014 then local trial7033_state = role.GetTrialState(RoleID, 7033) if trial7033_state == 0 then role.OpenTrain(RoleID, 7033) trial7033_state = role.GetTrialState(RoleID, 7033) end if trial7033_state == 1 then if role.GetTrialCompleteNum(RoleID, 7033) < 1 then role.SetTrialCompleteNum(RoleID, 7033, 1) end if role.GetTrialCompleteNum(RoleID, 7033) >= Trail_maxnum[7033] then role.TrialComplete(RoleID, 7033) end end elseif NewStoneTypeID == 3030034 then local trial7034_state = role.GetTrialState(RoleID, 7034) if trial7034_state == 0 then role.OpenTrain(RoleID, 7034) trial7034_state = role.GetTrialState(RoleID, 7034) end if trial7034_state == 1 then if role.GetTrialCompleteNum(RoleID, 7034) < 1 then role.SetTrialCompleteNum(RoleID, 7034, 1) end if role.GetTrialCompleteNum(RoleID, 7034) >= Trail_maxnum[7034] then role.TrialComplete(RoleID, 7034) end end elseif NewStoneTypeID == 3030042 then local trial7035_state = role.GetTrialState(RoleID, 7035) if trial7035_state == 0 then role.OpenTrain(RoleID, 7035) trial7035_state = role.GetTrialState(RoleID, 7035) end if trial7035_state == 1 then if role.GetTrialCompleteNum(RoleID, 7035) < 1 then role.SetTrialCompleteNum(RoleID, 7035, 1) end if role.GetTrialCompleteNum(RoleID, 7035) >= Trail_maxnum[7035] then role.TrialComplete(RoleID, 7035) end end elseif NewStoneTypeID == 3030077 then local trial7036_state = role.GetTrialState(RoleID, 7036) if trial7036_state == 0 then role.OpenTrain(RoleID, 7036) trial7036_state = role.GetTrialState(RoleID, 7036) end if trial7036_state == 1 then if role.GetTrialCompleteNum(RoleID, 7036) < 1 then role.SetTrialCompleteNum(RoleID, 7036, 1) end if role.GetTrialCompleteNum(RoleID, 7036) >= Trail_maxnum[7036] then role.TrialComplete(RoleID, 7036) end end elseif NewStoneTypeID == 3030085 then local trial7037_state = role.GetTrialState(RoleID, 7037) if trial7037_state == 0 then role.OpenTrain(RoleID, 7037) trial7037_state = role.GetTrialState(RoleID, 7037) end if trial7037_state == 1 then if role.GetTrialCompleteNum(RoleID, 7037) < 1 then role.SetTrialCompleteNum(RoleID, 7037, 1) end if role.GetTrialCompleteNum(RoleID, 7037) >= Trail_maxnum[7037] then role.TrialComplete(RoleID, 7037) end end end return 0 end end for i in pairs(StoneLevel7) do if not called and (TypeID == StoneLevel7[i]) then role.AddRoleItem(MapID, InstanceID, RoleID, NewStoneTypeID, 7, 6, 8, 420) called = true -- Достижения камней 7 ур. - проверка при создании камней уровня 7 if NewStoneTypeID == 3030007 then local trial8053_state = role.GetTrialState(RoleID, 8053) if trial8053_state == 0 then role.OpenTrain(RoleID, 8053) trial8053_state = role.GetTrialState(RoleID, 8053) end if trial8053_state == 1 then if role.GetTrialCompleteNum(RoleID, 8053) < 1 then role.SetTrialCompleteNum(RoleID, 8053, 1) end if role.GetTrialCompleteNum(RoleID, 8053) >= Trail_maxnum[8053] then role.TrialComplete(RoleID, 8053) end end elseif NewStoneTypeID == 3030015 then local trial8054_state = role.GetTrialState(RoleID, 8054) if trial8054_state == 0 then role.OpenTrain(RoleID, 8054) trial8054_state = role.GetTrialState(RoleID, 8054) end if trial8054_state == 1 then if role.GetTrialCompleteNum(RoleID, 8054) < 1 then role.SetTrialCompleteNum(RoleID, 8054, 1) end if role.GetTrialCompleteNum(RoleID, 8054) >= Trail_maxnum[8054] then role.TrialComplete(RoleID, 8054) end end elseif NewStoneTypeID == 3030035 then local trial8055_state = role.GetTrialState(RoleID, 8055) if trial8055_state == 0 then role.OpenTrain(RoleID, 8055) trial8055_state = role.GetTrialState(RoleID, 8055) end if trial8055_state == 1 then if role.GetTrialCompleteNum(RoleID, 8055) < 1 then role.SetTrialCompleteNum(RoleID, 8055, 1) end if role.GetTrialCompleteNum(RoleID, 8055) >= Trail_maxnum[8055] then role.TrialComplete(RoleID, 8055) end end elseif NewStoneTypeID == 3030043 then local trial8056_state = role.GetTrialState(RoleID, 8056) if trial8056_state == 0 then role.OpenTrain(RoleID, 8056) trial8056_state = role.GetTrialState(RoleID, 8056) end if trial8056_state == 1 then if role.GetTrialCompleteNum(RoleID, 8056) < 1 then role.SetTrialCompleteNum(RoleID, 8056, 1) end if role.GetTrialCompleteNum(RoleID, 8056) >= Trail_maxnum[8056] then role.TrialComplete(RoleID, 8056) end end elseif NewStoneTypeID == 3030078 then local trial8057_state = role.GetTrialState(RoleID, 8057) if trial8057_state == 0 then role.OpenTrain(RoleID, 8057) trial8057_state = role.GetTrialState(RoleID, 8057) end if trial8057_state == 1 then if role.GetTrialCompleteNum(RoleID, 8057) < 1 then role.SetTrialCompleteNum(RoleID, 8057, 1) end if role.GetTrialCompleteNum(RoleID, 8057) >= Trail_maxnum[8057] then role.TrialComplete(RoleID, 8057) end end elseif NewStoneTypeID == 3030086 then local trial8058_state = role.GetTrialState(RoleID, 8058) if trial8058_state == 0 then role.OpenTrain(RoleID, 8058) trial8058_state = role.GetTrialState(RoleID, 8058) end if trial8058_state == 1 then if role.GetTrialCompleteNum(RoleID, 8058) < 1 then role.SetTrialCompleteNum(RoleID, 8058, 1) end if role.GetTrialCompleteNum(RoleID, 8058) >= Trail_maxnum[8058] then role.TrialComplete(RoleID, 8058) end end -- Достижения камней 8 ур. - проверка при создании камней уровня 8 elseif NewStoneTypeID == 3030008 then local trial9071_state = role.GetTrialState(RoleID, 9071) if trial9071_state == 0 then role.OpenTrain(RoleID, 9071) trial9071_state = role.GetTrialState(RoleID, 9071) end if trial9071_state == 1 then if role.GetTrialCompleteNum(RoleID, 9071) < 1 then role.SetTrialCompleteNum(RoleID, 9071, 1) end if role.GetTrialCompleteNum(RoleID, 9071) >= Trail_maxnum[9071] then role.TrialComplete(RoleID, 9071) end end elseif NewStoneTypeID == 3030016 then local trial9072_state = role.GetTrialState(RoleID, 9072) if trial9072_state == 0 then role.OpenTrain(RoleID, 9072) trial9072_state = role.GetTrialState(RoleID, 9072) end if trial9072_state == 1 then if role.GetTrialCompleteNum(RoleID, 9072) < 1 then role.SetTrialCompleteNum(RoleID, 9072, 1) end if role.GetTrialCompleteNum(RoleID, 9072) >= Trail_maxnum[9072] then role.TrialComplete(RoleID, 9072) end end elseif NewStoneTypeID == 3030036 then local trial9073_state = role.GetTrialState(RoleID, 9073) if trial9073_state == 0 then role.OpenTrain(RoleID, 9073) trial9073_state = role.GetTrialState(RoleID, 9073) end if trial9073_state == 1 then if role.GetTrialCompleteNum(RoleID, 9073) < 1 then role.SetTrialCompleteNum(RoleID, 9073, 1) end if role.GetTrialCompleteNum(RoleID, 9073) >= Trail_maxnum[9073] then role.TrialComplete(RoleID, 9073) end end elseif NewStoneTypeID == 3030044 then local trial9074_state = role.GetTrialState(RoleID, 9074) if trial9074_state == 0 then role.OpenTrain(RoleID, 9074) trial9074_state = role.GetTrialState(RoleID, 9074) end if trial9074_state == 1 then if role.GetTrialCompleteNum(RoleID, 9074) < 1 then role.SetTrialCompleteNum(RoleID, 9074, 1) end if role.GetTrialCompleteNum(RoleID, 9074) >= Trail_maxnum[9074] then role.TrialComplete(RoleID, 9074) end end elseif NewStoneTypeID == 3030079 then local trial9075_state = role.GetTrialState(RoleID, 9075) if trial9075_state == 0 then role.OpenTrain(RoleID, 9075) trial9075_state = role.GetTrialState(RoleID, 9075) end if trial9075_state == 1 then if role.GetTrialCompleteNum(RoleID, 9075) < 1 then role.SetTrialCompleteNum(RoleID, 9075, 1) end if role.GetTrialCompleteNum(RoleID, 9075) >= Trail_maxnum[9075] then role.TrialComplete(RoleID, 9075) end end elseif NewStoneTypeID == 3030087 then local trial9076_state = role.GetTrialState(RoleID, 9076) if trial9076_state == 0 then role.OpenTrain(RoleID, 9076) trial9076_state = role.GetTrialState(RoleID, 9076) end if trial9076_state == 1 then if role.GetTrialCompleteNum(RoleID, 9076) < 1 then role.SetTrialCompleteNum(RoleID, 9076, 1) end if role.GetTrialCompleteNum(RoleID, 9076) >= Trail_maxnum[9076] then role.TrialComplete(RoleID, 9076) end end end return 0 end end if NewStoneTypeID == 3050087 and Item_ID[TypeID] ~= nil then local FreeSize = role.GetBagFreeSize(RoleID) if FreeSize >= 3 then if Item_ID[TypeID].ID[1] ~= nil and math.random(100) <= Item_ID[TypeID].Percent[1] then role.AddRoleItem(MapID, InstanceID, RoleID, Item_ID[TypeID].ID[1],Item_ID[TypeID].num[1], -1, 8, 420) end if Item_ID[TypeID].ID[2] ~= nil and math.random(100) <= Item_ID[TypeID].Percent[2] then role.AddRoleItem(MapID, InstanceID, RoleID, Item_ID[TypeID].ID[2],Item_ID[TypeID].num[2], -1, 8, 420) end if Item_ID[TypeID].ID[3] ~= nil and math.random(100) <= Item_ID[TypeID].Percent[3] then role.AddRoleItem(MapID, InstanceID, RoleID, Item_ID[TypeID].ID[3],Item_ID[TypeID].num[3], -1, 8, 420) end return 0 else return 1 end end if NewStoneTypeID == 8220301 and TypeID ~= 8220201 then local temp = math.random(100) local guoqing1 = math.random(20) if(guoqing1 == 10) then local guoqing11 = math.random(5) if(guoqing11 == 3 ) then local guoqing16 = math.random(10) if(guoqing16 == 6) then local guoqing18 = math.random(2) if(guoqing18 == 1) then local guoqing19 = math.random(3) if(guoqing19 == 2) then role.AddRoleItem(MapID, InstanceID, RoleID, 8220400,1, 6, 8, 420) else role.AddRoleItem(MapID, InstanceID, RoleID, 8220398+temp%2,1, 6, 8, 420) end else role.AddRoleItem(MapID, InstanceID, RoleID, 8220391+temp%7,1, 6, 8, 420) --17-18 уровни end else role.AddRoleItem(MapID, InstanceID, RoleID, 8220373+temp%18,1, 6, 8, 420) --14-16 уровни end else role.AddRoleItem(MapID, InstanceID, RoleID, 8220346+temp%27,1, 6, 8, 420) --11-13 уровни end else role.AddRoleItem(MapID, InstanceID, RoleID, 8220301+temp%45,1, 6, 8, 420) --обычные предметы end return 0 end -- Синтез фрагментов экипировки героя if DianJinID == 4800249 and (TypeID >= 4820192 and TypeID <= 4820227)then role.AddRoleItem(MapID, InstanceID, RoleID, 4800248,25,-1, 8, 420) --25 фрагментов return 0 end -- Камни пробуждения local Item_ID_1 = {} Item_ID_1[3030421] = {3030031,3030039} Item_ID_1[3030422] = {3030032,3030040} Item_ID_1[3030423] = {3030033,3030041} Item_ID_1[3030424] = {3030034,3030042} Item_ID_1[3030425] = {3030035,3030043} Item_ID_1[3030426] = {3030036,3030044} if Item_ID_1[TypeID] then local FreeSize = role.GetBagFreeSize(RoleID) if FreeSize > 1 then role.AddRoleItem(MapID, InstanceID, RoleID, Item_ID_1[TypeID][1],1, -1, 8, 420) role.AddRoleItem(MapID, InstanceID, RoleID, Item_ID_1[TypeID][2],1, -1, 8, 420) return 0 else return 1 end end -- Обработка камней - удалено if TypeID >= 3030001 and TypeID <= 3040000 and NewStoneTypeID ~= 3050087 then if role.GetTrialCompleteNum(RoleID, 4013) < 1 and role.GetTrialState(RoleID, 4013) >= 1 then role.SetTrialCompleteNum(RoleID, 4013, 1) end if role.GetTrialState(RoleID, 4013) == 1 and role.GetTrialCompleteNum(RoleID, 4013) >= Trail_maxnum[4013] then role.TrialComplete(RoleID, 4013) end end return NewStoneTypeID end function x_OnBrandEquip(MapID, InstanceID, RoleID, EquipID, ItemID, Sucess, Times) if Sucess == 1 then local Trail = {7006,8010,9027} for i = 1,3 do if role.GetTrialCompleteNum(RoleID,Trail[i]) < Times and role.GetTrialState(RoleID, Trail[i]) >= 1 then role.SetTrialCompleteNum(RoleID, Trail[i], Times) end if role.GetTrialState(RoleID, Trail[i]) == 1 and role.GetTrialCompleteNum(RoleID,Trail[i]) >= Trail_maxnum[Trail[i]] then role.TrialComplete(RoleID,Trail[i]) end end end end function x_OnChooseGrowAtt(RoleID,MapID,InstanceID, TypeID, color) local krulo = {} krulo[1 ] = 7800110 krulo[2 ] = 7800210 krulo[3 ] = 7800310 krulo[4 ] = 7800410 krulo[5 ] = 7800510 krulo[6 ] = 7800610 krulo[7 ] = 7800710 krulo[8 ] = 7800810 krulo[9 ] = 7800910 krulo[10 ] = 7801010 krulo[11 ] = 7801110 krulo[12 ] = 7801210 krulo[13 ] = 7801310 krulo[14 ] = 7801410 krulo[15 ] = 7801510 krulo[16 ] = 7801610 local random_krulo = math.random(16) local tbl_krulo = {8039047,8099013,8099022,8099068,8099069,8099070,8099071,8099072,8099073,8099074,8099075,8099076,8099077,8099078,8099079,8099080,8099081,8099082,8099083,8099084,8099085,8099086,8099087,8099088,8099089,8099090,8099091,8099092,8099093,8099094,8099095,8099096,8099097,8099098,8099099,8099100,8099101,8099102,8099103,8099104,8099105,8099106,8099107,8099108,8099109,8099110,8099111,8099112,8099113,8099114,8099115,8099116,8099117,8099118,8099119,8099120,8099121,8099122,8099123,8099124,8099125,8099126,8099127,8099128,8099129,8099130,8099131,8099312,8099313,8099314,8099315,8099316,8099317,8099318,8099432,8099433,8099434,8099435,8099436,8099437,8099438,8099453,8099454,8099455,8099456,8099457,8099458,8099608,8099609,8099610,8099611,8099612,8099613,8099643,8099644,8099645,8099646,8099647,8099648,8099649,8099650,8099651,8099652,8099653,8099654,8099748,8099749,8099750,8099751,8099752,8099753,8099779,8099780,8099781,8099782,8099783,8099784,8099814,8099815,8099816,8099817,8099818,8099819,8099823,8099824,8099825,8099826,8099827,8099828} for i = 1,#tbl_krulo do if TypeID == tbl_krulo[i] then return krulo[random_krulo] end end local snariagaFM = {} snariagaFM[1] = 2100111 snariagaFM[2] = 2100211 snariagaFM[3] = 2100311 snariagaFM[4] = 2100411 snariagaFM[5] = 2100511 snariagaFM[6] = 2100611 snariagaFM[7] = 2100711 snariagaFM[8] = 2100811 snariagaFM[9] = 2100911 snariagaFM[10] = 2101011 snariagaFM[11] = 2101111 snariagaFM[12] = 2101211 snariagaFM[13] = 2101311 snariagaFM[14] = 2101411 snariagaFM[15] = 2101511 snariagaFM[16] = 2101611 local random_snariagaFM = math.random(16) local tbl_snariagaFM = {8099716,8099717,8099718,8099719,8099720,8099721,8099725,8099726,8099727,8099728,8099729,8099730} for i = 1,#tbl_snariagaFM do if TypeID == tbl_snariagaFM[i] then return snariagaFM[random_snariagaFM] end end local pushkaF = {} pushkaF[1] = 1100111 pushkaF[2] = 1100211 pushkaF[3] = 1100311 pushkaF[4] = 1100411 pushkaF[5] = 1100511 pushkaF[6] = 1100611 pushkaF[7] = 1100711 pushkaF[8] = 1100811 pushkaF[9] = 1100911 pushkaF[10] = 1101011 pushkaF[11] = 1101111 pushkaF[12] = 1101211 pushkaF[13] = 1101311 pushkaF[14] = 1101411 pushkaF[15] = 1101511 pushkaF[16] = 1101611 pushkaF[17] = 1101711 pushkaF[18] = 1101811 local random_pushkaF = math.random(18) local tbl_pushkaF = {8099712,8099713} for i = 1,#tbl_pushkaF do if TypeID == tbl_pushkaF[i] then return pushkaF[random_pushkaF] end end local tochnF = {} tochnF[1] = 8200110 tochnF[2] = 8200210 tochnF[3] = 8200310 tochnF[4] = 8200410 tochnF[5] = 8200510 tochnF[6] = 8200610 tochnF[7] = 8200710 tochnF[8] = 8200810 tochnF[9] = 8200910 tochnF[10] = 8201010 local random_tochnF = math.random(10) local tbl_tochnF = {8099408} for i = 1,#tbl_tochnF do if TypeID == tbl_tochnF[i] then return tochnF[random_tochnF] end end local lovkssF = {} lovkssF[1] = 8300110 lovkssF[2] = 8300210 lovkssF[3] = 8300310 lovkssF[4] = 8300410 lovkssF[5] = 8300510 lovkssF[6] = 8300610 lovkssF[7] = 8300710 lovkssF[8] = 8300810 lovkssF[9] = 8300910 lovkssF[10] = 8301010 local random_lovkssF = math.random(10) local tbl_lovkssF = {8099406,8099407,8099408} for i = 1,#tbl_lovkssF do if TypeID == tbl_lovkssF[i] then return lovkssF[random_lovkssF] end end local pushkaM = {} pushkaM[1] = 1200111 pushkaM[2] = 1200211 pushkaM[3] = 1200311 pushkaM[4] = 1200411 pushkaM[5] = 1200511 pushkaM[6] = 1200611 pushkaM[7] = 1200711 pushkaM[8] = 1200811 pushkaM[9] = 1200911 pushkaM[10] = 1201011 pushkaM[11] = 1201111 pushkaM[12] = 1201211 pushkaM[13] = 1201311 pushkaM[14] = 1201411 pushkaM[15] = 1201511 pushkaM[16] = 1201611 pushkaM[17] = 1201711 pushkaM[18] = 1201811 local random_pushkaM = math.random(18) local tbl_pushkaM = {8099714,8099715} for i = 1,#tbl_pushkaM do if TypeID == tbl_pushkaM[i] then return pushkaM[random_pushkaM] end end local poyasF = {} poyasF[1] = 7100111 poyasF[2] = 7100211 poyasF[3] = 7100311 poyasF[4] = 7100411 poyasF[5] = 7100511 poyasF[6] = 7100611 poyasF[7] = 7100711 poyasF[8] = 7100811 poyasF[9] = 7100911 poyasF[10] =7101011 local random_poyasF = math.random(10) local tbl_poyasF = {8099724} for i = 1,#tbl_poyasF do if TypeID == tbl_poyasF[i] then return poyasF[random_poyasF] end end local poyasM = {} poyasM[1] = 7200111 poyasM[2] = 7200211 poyasM[3] = 7200311 poyasM[4] = 7200411 poyasM[5] = 7200511 poyasM[6] = 7200611 poyasM[7] = 7200711 poyasM[8] = 7200811 poyasM[9] = 7200911 poyasM[10] = 7201011 local random_poyasM = math.random(10) local tbl_poyasM = {8099733} for i = 1,#tbl_poyasM do if TypeID == tbl_poyasM[i] then return poyasM[random_poyasM] end end local bijuteria = {} bijuteria[1] = 5100111 bijuteria[2] = 5100211 bijuteria[3] = 5100311 bijuteria[4] = 5100411 bijuteria[5] = 5100511 bijuteria[6] = 5100611 bijuteria[7] = 5100711 bijuteria[8] = 5100811 bijuteria[9] = 5100911 bijuteria[10] = 5101011 local random_bijuteria = math.random(10) local tbl_bijuteria = {8099722,8099723,8099731,8099732} for i = 1,#tbl_bijuteria do if TypeID == tbl_bijuteria[i] then return bijuteria[random_bijuteria] end end local kad = {} kad[1 ] = 7800108 kad[2 ] = 7800208 kad[3 ] = 7800308 kad[4 ] = 7800408 kad[5 ] = 7800508 kad[6 ] = 7800608 kad[7 ] = 7800708 kad[8 ] = 7800808 kad[9 ] = 7800908 kad[10] = 7801008 kad[11] = 7801108 kad[12] = 7801208 kad[13] = 7801308 kad[14] = 7801408 kad[15] = 7801508 kad[16] = 7801608 kad[17] = 7800109 kad[18] = 7800209 kad[19] = 7800309 kad[20] = 7800409 kad[21] = 7800509 kad[22] = 7800609 kad[23] = 7800709 kad[24] = 7800809 kad[25] = 7800909 kad[26] = 7801009 kad[27] = 7801109 kad[28] = 7801209 kad[29] = 7801309 kad[30] = 7801409 kad[31] = 7801509 kad[32] = 7801609 local random_kad = math.random(32) local tbl_kad = {8099068} for i = 1,#tbl_kad do if TypeID == tbl_kad[i] then return kad[random_kad] end end local kad33 = {} kad33[1 ] = 2200106 kad33[2 ] = 2200206 kad33[3 ] = 2200306 kad33[4 ] = 2200406 kad33[5 ] = 2200506 kad33[6 ] = 2200606 kad33[7 ] = 2200706 kad33[8 ] = 2200806 kad33[9 ] = 2200906 kad33[10] = 2201006 kad33[11] = 2201106 kad33[12] = 2201206 kad33[13] = 2201306 kad33[14] = 2201406 kad33[15] = 2201506 kad33[16] = 2201606 kad33[17] = 2201706 kad33[18] = 2201806 kad33[19] = 2201906 local random_kad33 = math.random(19) local tbl_kad33 = {8099520,8099521,8099522,8099523,8099524,8099525,8099526,8099527,8099528,8099529,8099530,8099531,8099532,8099533,8099534,8099535,8099536,8099537,8099538,8099539,8099540,8099541,8099542,8099543} for i = 1,#tbl_kad33 do if TypeID == tbl_kad33[i] then return kad33[random_kad33] end end local kad31 = {} kad31[1 ] = 7200106 kad31[2 ] = 7200206 kad31[3 ] = 7200306 kad31[4 ] = 7200406 kad31[5 ] = 7200506 kad31[6 ] = 7200606 local random_kad31 = math.random(6) local tbl_kad31 = {8099550,8099551} for i = 1,#tbl_kad31 do if TypeID == tbl_kad31[i] then return kad31[random_kad31] end end local kad311 = {} kad311[1 ] = 7100106 kad311[2 ] = 7100206 kad311[3 ] = 7100306 kad311[4 ] = 7100406 kad311[5 ] = 7100506 kad311[6 ] = 7100606 local random_kad311 = math.random(6) local tbl_kad311 = {8099548,8099549} for i = 1,#tbl_kad311 do if TypeID == tbl_kad311[i] then return kad311[random_kad311] end end local big11 = {} big11[1 ] = 5100106 big11[2 ] = 5100206 big11[3 ] = 5100306 big11[4 ] = 5100406 big11[5 ] = 5100506 big11[6 ] = 5100606 big11[7 ] = 5100706 big11[8 ] = 5100806 big11[9 ] = 5100906 big11[10] = 5101006 big11[11] = 5101106 local random_big11 = math.random(11) local tbl_big11 = {8099544,8099545,8099546,8099547,8099552,8099553,8099554,8099555,8099556,8099557,8099558,8099559} for i = 1,#tbl_big11 do if TypeID == tbl_big11[i] then return big11[random_big11] end end local bi1g11 = {} bi1g11[1 ] = 1100106 bi1g11[2 ] = 1100206 bi1g11[3 ] = 1100306 bi1g11[4 ] = 1100406 bi1g11[5 ] = 1100506 bi1g11[6 ] = 1100606 bi1g11[7 ] = 1100706 bi1g11[8 ] = 1100806 bi1g11[9 ] = 1100906 bi1g11[10] = 1101006 local random_bi1g11 = math.random(10) local tbl_bi1g11 = {8099560,8099561} for i = 1,#tbl_bi1g11 do if TypeID == tbl_bi1g11[i] then return bi1g11[random_bi1g11] end end local bi1g12 = {} bi1g12[1 ] = 1200106 bi1g12[2 ] = 1200206 bi1g12[3 ] = 1200306 bi1g12[4 ] = 1200406 bi1g12[5 ] = 1200506 bi1g12[6 ] = 1200606 bi1g12[7 ] = 1200706 bi1g12[8 ] = 1200806 bi1g12[9 ] = 1200906 bi1g12[10] = 1201006 local random_bi1g12 = math.random(10) local tbl_bi1g12 = {8099562,8099563} for i = 1,#tbl_bi1g12 do if TypeID == tbl_bi1g12[i] then return bi1g12[random_bi1g12] end end local function GetEqupPosAndType(TypeID) --ͨ�����м�¼����������ȡ�÷����ĸ��ε����� local type1,type2 if TypeID == 8039008 then return 7201010 end -------------------------------------- if TypeID > 8000000 then local typenum = math.floor((TypeID - 8000000)/1000) if typenum < 30 then type1 = 1100000 elseif typenum < 50 then type1 = 1200000 elseif typenum < 80 then type1 = 2000000 + (typenum%10+1)*100000 elseif typenum < 100 then type1 = 3000000 + (typenum%10+1)*100000 elseif typenum < 110 then type1 = 4100000 + (math.random(2)-1)*100000 elseif typenum < 120 then type1 = 5000000 + (typenum%10+1)*100000 elseif typenum < 130 then type1 = 6000000 + typenum%10*100000 elseif typenum < 140 then type1 = 7100000 + (math.random(2)-1)*100000 end if TypeID%100 >=12 and TypeID%100 <= 17 and type1 ~= nil then type2 = TypeID%100 - 13 if type2 <= 0 then type2 = 2 end end if TypeID%100 >=18 and TypeID%100 <= 20 and type1 ~= nil then type2 = TypeID%100 - 12 end end -------------------------------------- --����������ָ����ID,���ڴ�ֱ��ָ�� if TypeID == 8010012 or TypeID == 8020012 then type2 = 5 elseif TypeID == 8030012 or TypeID == 8040012 then type2 = 5 elseif TypeID == 8049003 or TypeID == 8039003 or TypeID == 8029003 or TypeID == 8019003 or TypeID == 8111916 or TypeID == 8111917 or TypeID == 8111918 or TypeID == 8111919 or TypeID == 8110916 or TypeID == 8110917 or TypeID == 8110918 or TypeID == 8110919 or TypeID == 8019006 or TypeID == 8029006 or TypeID == 8039006 or TypeID == 8049006 then type2 = 5 elseif TypeID == 8213207 or TypeID == 8212207 or TypeID == 8211207 or TypeID == 8210207 then type2 = 5 else local tbl = {8050912,8050913,8051912,8051913,8060912,8060913,8061912,8061913,8070912,8070913,8071912,8071913,8080912,8080913,8081912,8081913,8090912,8090913,8091912,8091913,8101323,8101324,8101325,8101326,8110914,8110915,8111914,8111915,8121910,8121911,8122910,8122911,8130919,8130920,8130921,8130922} for i = 1,#tbl do if TypeID < tbl[i] then break elseif TypeID == tbl[i] then type2 = 5 end end local tbl2 = {8019004,8050914,8060914,8070914,8080914,8090914,8101327,8110920,8121912,8130923,8029004,8050915,8060915,8070915,8080915,8090915,8101328,8110921,8121913,8130924,8049004,8051914,8061914,8071914,8081914,8091914,8101329,8111920,8122912,8130925,8039004,8039004,8051915,8061915,8071915,8081915,8091915,8101330,8111921,8122913,8130926,8112011,8112012,8112015,8440564,8440565,8440566,8440567,8440568,8440569,8440570,8440571,8440572,8440573,8440574,8440575,8440576,8440577,8440578,8440579,8440580,8440581,8440582,8440583,8440584,8440585,8440586,8440587,8440588,8440589,8440590,8440591,8440592,8440593,8440594,8440595,8440596,8440597,8440598,8440599,8440600,8440601,8440602,8440603,8440604,8440605,8440606,8440607,8440608,8440609,8440610,8440611,8440612,8440613,8440614,8440615,8440616,8440617,8440618,8440619,8440620,8440621,8440622,8440623,8440624,8440625,8440626,8440627,8440628,8440629,8440630,8440631,8440632,8440633,8440634,8440635,8440636,8440637,8440638,8440639,8440640,8440641,8440642,8440643,8440644,8440645,8440646,8440647,8440648,8440649,8440650,8440651,8440652,8440653,8440654,8440655,8440656,8440657,8440658,8440659} for i = 1,#tbl2 do if TypeID == tbl2[i] then type2 = 5 end end end if TypeID == 8101323 or TypeID == 8101324 then type1 = 4100000 elseif TypeID == 8101325 or TypeID == 8101326 then type1 = 4200000 elseif TypeID == 8130919 or TypeID == 8130920 then type1 = 5100000 elseif TypeID == 8130921 or TypeID == 8130922 then type1 = 5200000 end return type1,type2 end local type1,type2 = GetEqupPosAndType(TypeID) local LevelNum = {} LevelNum[1100000] = {5,5,5,10,10,10,10,15,15,28,28} LevelNum[1200000] = {5,5,5,10,10,10,10,15,15,28,28} LevelNum[2100000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[2200000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[3100000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[3200000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[4100000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[4200000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[5100000] = {5,5,5,5,5,11,10,10,10,10,10} LevelNum[5200000] = {5,5,5,5,5,11,10,10,10,10,10} LevelNum[6100000] = {5,5,5,5,5,11,10,10,10,10,10} LevelNum[6200000] = {5,5,5,5,5,11,10,10,10,10,10} LevelNum[7100000] = {6,7,6,6,6,6,5,10,10,10,10} LevelNum[7200000] = {6,7,6,6,6,6,5,10,10,10,10} LevelNum[7800000] = {0,0,0,0,0,0,16,16,16,16,16} LevelNum[8100000] = {0,0,0,0,0,0,0,0,0,10,10} LevelNum[8200000] = {0,0,0,0,0,0,0,0,0,10,10} LevelNum[8300000] = {0,0,0,0,0,0,0,0,0,10,10} if type2 ~= nil and type2 == 5 then local tbl2 = {8099712,8099713,8099714,8099715,8099716,8099717,8099718,8099719,8099720,8099721,8099722,8099723,8099724,8099725,8099726,8099727,8099728,8099729,8099730,8099731,8099732,8099733,8010027,8130920,8130919,8130920,8130921,8010027,8220522,8220523,8010028,8010029,8010030,8010031,8010032,8010037,8010033,8010034,8010035,8010036,8010038,8010038,8010039,8010040,8010041,8010042,8010043,8010044,8010045,8010046,8010047,8010048,8010049,8010049,8010050,8010051,8010052,8010053,8010054,8010055,8010056,8010057,8010058,8010059,8010060,8010060,8010061,8010062,8010063,8010064,8010065,8010066,8010067,8010068,8010069,8010070,8112011,8112020,8112012,8112016,8440564,8440565,8440566,8440567,8440568,8440569,8440570,8440571,8440572,8440573,8440574,8440575,8440576,8440577,8440578,8440579,8440580,8440581,8440582,8440583,8440584,8440585,8440586,8440587,8440588,8440589,8440590,8440591,8440592,8440593,8440594,8440595,8440596,8440597,8440598,8440599,8440600,8440601,8440602,8440603,8440604,8440605,8440606,8440607,8440608,8440609,8440610,8440611,8440612,8440613,8440614,8440615,8440616,8440617,8440618,8440619,8440620,8440621,8440622,8440623,8440624,8440625,8440626,8440627,8440628,8440629,8440630,8440631,8440632,8440633,8440634,8440635,8440636,8440637,8440638,8440639,8440640,8440641,8440642,8440643,8440644,8440645,8440646,8440647,8440648,8440649,8440650,8440651,8440652,8440653,8440654,8440655,8440656,8440657,8440658,8440659,8099068,8099069,8099070,8099071,8099072,8099073,8099074,8099075,8099076,8099070,68099078,8099079,8099080,8099081,8099082,8099083,8099084,8099085,8099086,8099087,8099088,9000323,9000336,9000343,9000342,8099090,8099312,9000344,8099313,8099314,8099315,8099316,8099619,8099620,8099621,8099622,8099623,8099624,8099627,8099629,8099631,8099632,8099633,8099636,8099637,8099638,8099639,8099640,8099634,8099635,8099628,8099630,8099625,8099626,8099317,8099318,8099319,8099320} for i = 1,#tbl2 do if TypeID == tbl2[i] then local tbl = {1100611,1101111,1201111,1201111,3101711,3101711,3101711,3101711,3101711,4201711,6201011,6201011,7100711,3101711,3101711,3101711,3101711,3101711,4201711,6201011,6201011,7200911,1101310,5100110,5100110,5200110,5200110,1101310,1100611,1200611,1090002,3100510,3100510,3100510,3100510,3100510,4100510,5100810,5100810,5100810,7100310,1101310,1101310,3100510,3100510,3100510,3100510,3100510,4100510,5100810,5100810,5100810,7100310,1201310,1201310,3100510,3100510,3100510,3100510,3100510,4100510,5100810,5100810,5100810,7200310,1201310,1201310,3100510,3100510,3100510,3100510,3100510,4100510,5100810,5100810,5100810,5100310,5200310,5200310,5200310,1101310,1101310,1201310,1201310,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,6201010,6201010,6201010,6201010,1101310,1101310,1201310,1201310,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,6201010,6201010,6201010,6201010,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510,3100510} return tbl[i] end end local tbl3 = {8019004,8019004,8050914,8060914,8070914,8080914,8090914,8101327,8110920,8110920,8121912,8130923,8029004,8029004,8050915,8060915,8070915,8080915,8090915,8101328,8110921,8110921,8121913,8130924,8049004,8049004,8051914,8061914,8071914,8081914,8091914,8101329,8111920,8111920,8122912,8130925,8039004,8039004,8051915,8061915,8071915,8081915,8091915,8101330,8111921,8111921,8122913,8130926} for i = 1,#tbl3 do if TypeID == tbl3[i] then local tbl = {1101303,1101303,2101703,2101703,2101703,3101703,3101703,4101703,5100503,5100503,5100503,7100803,1101303,1101303,2101703,2101703,2101703,3101703,3101703,4101703,5100503,5100503,5100503,7100803,1201303,1201303,2101703,2101703,2101703,3101703,3101703,4101703,5100503,5100503,5100503,7100803,1201303,1201303,2101703,2101703,2101703,3101703,3101703,4101703,5100503,5100503,5100503,5100503} return tbl[i] end end if TypeID == 8010012 or TypeID == 8020012 then return 1 elseif TypeID == 8030012 or TypeID == 8040012 then return 2 elseif TypeID == 8213207 or TypeID == 8212207 then return 1201508 elseif TypeID == 8211207 or TypeID == 8210207 then return 1101508 elseif TypeID == 8049003 or TypeID == 8039003 or TypeID == 8029003 or TypeID == 8019003 or TypeID == 8111916 or TypeID == 8111917 or TypeID == 8111918 or TypeID == 8111919 or TypeID == 8110916 or TypeID == 8110917 or TypeID == 8110918 or TypeID == 8110919 or TypeID == 8019006 or TypeID == 8029006 or TypeID == 8039006 or TypeID == 8049006 then return type1 + math.random(LevelNum[type1][10])*100 + 10 else local k = math.random(100) if k > 95 then return type1 + math.random(LevelNum[type1][10])*100 + 10 elseif k > 80 then return type1 + math.random(LevelNum[type1][9])*100 + 9 else return type1 + math.random(LevelNum[type1][8])*100 + 8 end end elseif type2 ~= nil and type2 >= 6 and type2 <= 8 then return type1 + math.random(LevelNum[type1][TypeID%100-10])*100 + TypeID%100-10 elseif type2 ~= nil and type1 ~= nil then --60����ֻ������������������ѡ,70���Ŀ�����1-4����ѡ,��ɫ��80���Ļ��1-8����ѡ,��ɫ�Ļ���7-10����ѡ --[[�˶�Ϊװ���ɳ�����Ҫ���ɽű� ��ÿ����ͨ������װ2000��,��ôÿ����Ի��7������40��,8������20��,�������һ��8�����Խ�����40���� ��ÿ������װ20��,��ôÿ����Ի��7������10��,8������10�� ����,��һ����ߵڶ���,�������һ��9�����ԡ� ֮��,9�����Խ���ÿ�����2������ 10������ÿ5����2�� ]] local index = 1 local level = 1 if type2 == 1 then --60����10%Ϊ3������,20%Ϊ2������ local k = math.random(100) if k > 90 then level = 3 elseif k > 70 then level = 2 end elseif type2 == 2 then --70����10%Ϊ4������,20%Ϊ3������,30%Ϊ2������ local k = math.random(100) if k > 90 then level = 4 elseif k > 70 then level = 3 elseif k > 40 then level = 2 end elseif type2 == 3 then --80����ɫ��100,120,210,340,100,100,20,10��Ϊ1-8������,��λΪǧ��֮һ�����8�����Ե���������40,��ô7��������50%���ʱ�Ϊ8�� local k = math.random(1000) local tbl3 = {100,120,210,340,100,100,20,10} local q = 0 for i = 1,8 do q = q + tbl3[i] if q >= k then level = i break end end if level == 7 and act.GetActScriptData(29, 1, 0) < 40 then if math.random(2) == 1 then level = 8 end end if level == 8 then act.SetActScriptData(29, 1, 0, act.GetActScriptData(29, 1, 0)+1) act.SaveActScriptData(29) end elseif type2 == 4 then --80����ɫ��490,450,50,10��Ϊ7-10������,��λΪǧ��֮һ�����8�����Ե���������9����9��,����30%����ת��Ϊ9��,���9�����Զ���10��5��,����10%����ת��Ϊ10�� local k = math.random(1000) local tbl3 = {490,450,50,10} --8����9��10���ĵ����Ϊ45��5��1 local q = 0 for i = 1,4 do q = q + tbl3[i] if q >= k then level = i + 6 break end end local num1 = act.GetActScriptData(29, 1, 0) local num2 = act.GetActScriptData(29, 1, 1) local num3 = act.GetActScriptData(29, 1, 2) if num1 == 0 then num1 = 1 end if num2 == 0 then num2 = 1 end if num3 == 0 then num3 = 1 end if num1/num2 > 9 then if math.random(10) >= 8 then level = 9 end end if num2/num3 > 5 then if math.random(10) >= 10 then level = 10 end end if level > 7 then act.SetActScriptData(29, 1, level-8, act.GetActScriptData(29, 1, level-8)+1) act.SaveActScriptData(29) end end index = type1 + math.random(LevelNum[type1][level])*100 + level return index elseif type2 == nil and type1 ~= nil then return type1 + 101 else return 1 end end function x_OnGetAnewStart(RoleID, MapID, InstanceID, TypeID, color, TotalTimesGetStar, TotoleIMItemUsed, NowStarNum, GrayStarNum, GreenStarNum, BlueStarNum, PurpleStarNum, GoldenStarNum, RedStarNum, GlyerStarNum, Glyer2StarNum, Glyer3StarNum, Glyer4StarNum, Glyer5StarNum, Glyer6StarNum, Glyer7StarNum, ImItemID) ------------------------���ⶨ��------------------------------------ local tbl2 = {8019004,8019004,8050914,8060914,8070914,8080914,8090914,8101327,8110920,8110920,8121912,8130923,8029004,8029004,8050915,8060915,8070915,8080915,8090915,8101328,8110921,8110921,8121913,8130924,8049004,8049004,8051914,8061914,8071914,8081914,8091914,8101329,8111920,8111920,8122912,8130925,8039004,8039004,8051915,8061915,8071915,8081915,8091915,8101330,8111921,8111921,8122913,8130926} for i = 1,#tbl2 do if TypeID == tbl2[i] then return 5 end end if TypeID == 8213207 or TypeID == 8212207 or TypeID == 8211207 or TypeID == 8210207 then return 5 end --[[if TypeID == 8112015 then return 5 end]] ---------------------------------------------------------------------------- local gray,green,blue,pink,golden = 200,540,230,29,1 --ǰ4�εĸ��ʾ������⴦�� if NowStarNum <= 4 then green = green - (5-NowStarNum)*10 blue = blue + (5-NowStarNum)*6 pink = pink + (5-NowStarNum)*3 golden = golden + (5-NowStarNum) end if ImItemID ~= nil and ImItemID ~= 0 then if ImItemID == 4820180 then return 4 elseif ImItemID == 4810109 then return 5 elseif ImItemID == 1240110 then return 6 elseif ImItemID == 1240111 then return 7 elseif ImItemID == 1240112 then return 8 elseif ImItemID == 1240113 then return 9 elseif ImItemID == 1240114 then return 10 elseif ImItemID == 1240115 then return 11 end gray,green,blue,pink,golden = 100,540,286,70,4 if NowStarNum <= 4 then green = green - (5-NowStarNum)*10 --blue = blue + (5-NowStarNum)*10 pink = pink + (5-NowStarNum)*10 --golden = golden + (5-NowStarNum)*10 end end if NowStarNum <= 6 then --����6���IJ����������ӳ� local p = 10 if NowStarNum >= 6 then p = 30 end local k = math.floor(TotalTimesGetStar/p) if k > 8 then k = 8 end green = green - 3 * k blue = blue + 2 * k pink = pink + 1 * k --golden = golden + k end if TotoleIMItemUsed == 0 then TotoleIMItemUsed = 1 end local Q = math.random(1000) if Q <= gray then return 1 elseif Q <= gray+green then return 2 elseif Q <= gray+green+blue then return 3 elseif Q <= gray+green+blue+pink then return 4 else if NowStarNum <= 6 then return 5 else if 0.2 ^ (11 - NowStarNum) *2.5* math.floor(2500/TotoleIMItemUsed^0.5) >= math.random(1000) then return 4 else return 5 end end end end function x_OnSoulCrystal_GetZiZhi(TypeID) --������С����С��10 if TypeID == 8220401 or TypeID == 8220402 then return 50 elseif TypeID == 8220403 or TypeID == 8220404 or TypeID == 8220521 or TypeID == 8220522 or TypeID == 8220523 or TypeID == 8220621 or TypeID == 8220622 or TypeID == 8220623 then return 80 elseif TypeID >= 8220501 and TypeID <= 8220620 then --------------------------------------------------�ض��꾧����--------------------------------------------------------------------------------------- if TypeID >= 8220525 and TypeID <= 8220530 then return 90 --------------------------------------------------��ͨ�꾧����--------------------------------------------------------------------------------------- else local index = 18 --10����15����16���ϵı�����100��10��1 if TypeID%100 <= 10 then --10���µĻ��� index = index + TypeID%100 * 2 elseif TypeID%100 <= 15 then --15���µĻ��� index = index + 20 + (TypeID%100 - 10) * 3 else --16���ϵĻ��� index = 56 + (TypeID%100 -15)*4 end if index < 56 then index = math.random(56-index) + index end if index >= 56 then for i = 1,(80-index) do if math.random(10) > 4 then --60%���Լ�һ index = index + 1 else break end end end return index end end end function x_OnSoulCrystal_GetSkill(TypeID, ZiZhi) local pct = {1000-math.floor(280*ZiZhi/100)-math.floor(20*ZiZhi/100),math.floor(280*ZiZhi/100),math.floor(20*ZiZhi/100)} local index = math.random(1000) if pct[1] >= index then index = 1 elseif pct[1] + pct[2] >= index then index = 2 else index = 3 end if TypeID == 8220401 or TypeID == 8220403 or (TypeID >= 8220501 and TypeID <= 8220599) then --------------------------------------------------�ض��꾧����--------------------------------------------------------------------------------------- if TypeID == 8220524 or (TypeID >= 8220525 and TypeID <= 8220530) then return 2602501 --------------------------------------------------��ͨ�꾧����--------------------------------------------------------------------------------------- else if index == 1 then return 2600001 + (math.random(8) - 1) * 100 elseif index == 2 then return 2600801 + (math.random(13) - 1) * 100 else return 2602101 + (math.random(4) - 1) * 100 end end else if index == 1 then return 2610001 + (math.random(8) - 1) * 100 elseif index == 2 then return 2610801 + (math.random(13) - 1) * 100 else return 2612101 + (math.random(4) - 1) * 100 end end end ----------------------------------------�꾧����---------------------------------------------------------------------- gojijineng = {} gojijineng[1]={101310,80}--�߼����� gojijineng[2]={102310,80}--�߼����� gojijineng[3]={104310,80}--�߼���׼ gojijineng[4]={105310,80}--�߼����� gojijineng[5]={106310,80}--�߼����� gojijineng[6]={107310,10}--�߼�����˺����� gojijineng[7]={108310,10}--�߼������˺����� gojijineng[8]={109310,10}--�߼������˺����� gojijineng[9]={110310,10}--�߼�Ǭ���˺����� gojijineng[10]={111310,100}--�߼������˺����� gojijineng[11]={112310,100}--�߼������˺����� gojijineng[12]={113310,100}--�߼����� gojijineng[13]={114310,60}--�߼��������� gojijineng[14]={115310,60}--�߼��������� gojijineng[15]={116310,60}--�߼��������� gojijineng[16]={118310,60}--�߼��������� gojijineng[17]={120310,60}--�߼������ӳ� gojijineng[18]={121310,60}--�߼��������ӳ� gojijineng[19]={122310,60}--�߼����� gojijineng[20]={123310,60}--�߼�����ǿ�� gojijineng[21]={124310,10}--�߼�����˺����� gojijineng[22]={125310,10}--�߼������˺����� gojijineng[23]={126310,10}--�߼������˺����� gojijineng[24]={127310,10}--�߼�Ǭ���˺����� gojijineng[25]={128310,100}--�߼������˺����� gojijineng[26]={129310,100}--�߼������˺����� gojijineng[27]={130310,100}--�߼��������� gojijineng[28]={131310,100}--�߼��������� gojijineng[29]={132310,100}--�߼������������� gojijineng[30]={133310,100}--�߼������������� gojijineng[31]={302310,100}--�߼��˺����� gojijineng[32]={313310,100}--�߼��˺����� gojijineng[33]={101110,50}--�������� gojijineng[34]={102110,10}--�������� gojijineng[35]={104110,50}--������׼ gojijineng[36]={105110,50}--�������� gojijineng[37]={106110,50}--�������� gojijineng[38]={107110,10}--��������˺����� gojijineng[39]={108110,10}--���������˺����� gojijineng[40]={109110,10}--���������˺����� gojijineng[41]={110110,10}--����Ǭ���˺����� gojijineng[42]={111110,50}--���������˺����� gojijineng[43]={112110,50}--���������˺����� gojijineng[44]={113110,60}--�������� gojijineng[45]={114110,60}--������������ gojijineng[46]={115110,60}--������������ gojijineng[47]={116110,60}--������������ gojijineng[48]={118110,60}--������������ gojijineng[49]={120110,60}--���������ӳ� gojijineng[50]={121110,60}--�����������ӳ� gojijineng[51]={122110,60}--�������� gojijineng[52]={123110,60}--��������ǿ�� gojijineng[53]={124110,10}--��������˺����� gojijineng[54]={125110,10}--���������˺����� gojijineng[55]={126110,10}--���������˺����� gojijineng[56]={127110,10}--����Ǭ���˺����� gojijineng[57]={128110,150}--���������˺����� gojijineng[58]={129110,150}--���������˺����� gojijineng[59]={130110,100}--������������ gojijineng[60]={131110,100}--������������ gojijineng[61]={132110,100}--���������������� gojijineng[62]={133110,100}--���������������� gojijineng[63]={302110,100}--�����˺����� gojijineng[64]={313110,100}--�����˺����� gojijineng[65]={101210,250}--�м����� gojijineng[66]={102210,30}--�м����� gojijineng[67]={104210,200}--�м���׼ gojijineng[68]={105210,200}--�м����� gojijineng[69]={106210,250}--�м����� gojijineng[70]={107210,10}--�м�����˺����� gojijineng[71]={108210,10}--�м������˺����� gojijineng[72]={109210,10}--�м������˺����� gojijineng[73]={110210,10}--�м�Ǭ���˺����� gojijineng[74]={111210,250}--�м������˺����� gojijineng[75]={112210,250}--�м������˺����� gojijineng[76]={113210,50}--�м����� gojijineng[77]={114210,250}--�м��������� gojijineng[78]={115210,250}--�м��������� gojijineng[79]={116210,250}--�м��������� gojijineng[80]={118210,250}--�м��������� gojijineng[81]={120210,250}--�м������ӳ� gojijineng[82]={121210,300}--�м��������ӳ� gojijineng[83]={122210,300}--�м����� gojijineng[84]={123210,300}--�м�����ǿ�� gojijineng[85]={124210,10}--�м�����˺����� gojijineng[86]={125210,10}--�м������˺����� gojijineng[87]={126210,10}--�м������˺����� gojijineng[88]={127210,10}--�м�Ǭ���˺����� gojijineng[89]={128210,300}--�м������˺����� gojijineng[90]={129210,300}--�м������˺����� gojijineng[91]={130210,300}--�м��������� gojijineng[92]={131210,300}--�м��������� gojijineng[93]={132210,300}--�м������������� gojijineng[94]={133210,300}--�м������������� gojijineng[95]={302210,300}--�м��˺����� gojijineng[96]={313210,300}--�м��˺����� function x_OnSoulCrystal_GetAbility(MapID, InstanceID, TypeID, FirstTime, ZiZhi, Pct1, Pct2, RoleID, ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8) --RoleID�п�����-1����0 --[[ ���������������ij��ֱ����ǣ� 1��2��3 ]] local base = {} base[1] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33} base[2] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28} base[3] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15} --------------------------------------------------g�߼����ܱ�--------------------------------------------------------------------------------------- local suiji = {0, 0, 0, 0, 0, 0, 0, 0} local temp = 0 local x = 1 --------------------------------------------------�ض��꾧--------------------------------------------------------------------------------------- if TypeID == 8220524 then return 104310,104310,205310,105310,105310,206310,313310,313310 elseif TypeID == 8220527 then return 101310, 313310, 120310, 121310, 111310, 112310, 104310,105310 elseif TypeID == 8220528 then return 313310,313310,313310,313310,313310,313310,313310,313310 elseif TypeID == 8220529 then return 105310,105310,105310,105310,105310,105310,105310,105310 elseif TypeID == 8220530 then return 313310,313310,313310,313310,105310,105310,104310,104310 elseif TypeID == 8220525 then for i = 1,4 do local r = math.random(10000) for w = 1,96 do temp = temp + gojijineng[w][2] if temp >= r then x = w break end end suiji[i] = gojijineng[x][1] end return 101310, 313310, 120310, 121310, suiji[1], suiji[2], suiji[3], suiji[4] elseif TypeID == 8220526 then for i = 1,2 do local r = math.random(10000) for w = 1,96 do temp = temp + gojijineng[w][2] if temp >= r then x = w break end end suiji[i] = gojijineng[x][1] end return 101310, 313310, 120310, 121310, 111310, 112310, suiji[1], suiji[2] --------------------------------------------------��ͨ�꾧--------------------------------------------------------------------------------------- else if FirstTime == 1 then local tbl = {} local maxnum = 0 if math.floor(ZiZhi/10) < 5 then maxnum = math.random(3) else maxnum = math.random(3,math.floor(ZiZhi/10)-2) end for i=1,maxnum do local k = math.random(6) if k>= 4 then local q = math.random(#base[1]) tbl[i] = 100000 + base[1][q] * 1000 + math.random(3) * 100 + 1 table.remove(base[1],q) elseif k>= 2 then local q = math.random(#base[2]) tbl[i] = 200000 + base[2][q] * 1000 + math.random(3) * 100 + 1 table.remove(base[2],q) else local q = math.random(#base[3]) tbl[i] = 300000 + base[3][q] * 1000 + math.random(3) * 100 + 1 table.remove(base[3],q) end end return tbl[1],tbl[2],tbl[3],tbl[4],tbl[5],tbl[6],tbl[7],tbl[8] else Pct1 = Pct1 + 2* math.floor(ZiZhi^0.5) --�������������� Pct2 = Pct2 + ZiZhi --���������ĸ��� if Pct2 > 50 then Pct2 = Pct2 end if Pct2 > 70 then Pct2 = Pct2 end if Pct1 > 100 then Pct1 = 100 end if Pct2 > 100 then Pct2 = 100 end local tbl = {ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8} local max = 0 for i = 1,8 do if tbl[i] ~= nil and tbl[i] ~= 0 then if math.random(100) > 100 - Pct2 then if tbl[i]%10 ~= 0 then tbl[i] = tbl[i] + 1 end local delete = math.floor(tbl[i]/1000)-math.floor(tbl[i]/100000)*100 for k,v in pairs(base[math.floor(tbl[i]/100000)]) do if v == delete then table.remove(base[math.floor(tbl[i]/100000)],k) break end end end else max = i break end end if max ~= 0 then if math.random(100) > 100 - Pct1 then local k = math.random(6) if k>= 4 then local q = math.random(#base[1]) tbl[max] = 100000 + base[1][q] * 1000 + math.random(3) * 100 + 1 elseif k>= 2 then local q = math.random(#base[2]) tbl[max] = 200000 + base[2][q] * 1000 + math.random(3) * 100 + 1 else local q = math.random(#base[3]) tbl[max] = 300000 + base[3][q] * 1000 + math.random(3) * 100 + 1 end end end return tbl[1],tbl[2],tbl[3],tbl[4],tbl[5],tbl[6],tbl[7],tbl[8] end end end function x_OnSoulCrystal_ResetAbility(MapID, InstanceID, TypeID, ZiZhi, RoleID, ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8) local suiji = {0, 0, 0, 0, 0, 0, 0, 0} local temp = 0 local x = 1 local a,b = role.GetRoleSoul(MapID,InstanceID,RoleID) local bool =true if a~= nil and b ~= nil then if (TypeID == 8220401 or (TypeID >= 8220501 and TypeID <= 8220599)) and a < 20 then bool = false elseif (TypeID == 8220402 or (TypeID >= 8220601 and TypeID <= 8220699)) and b < 20 then bool = false end end if role.GetRoleSilver(MapID, InstanceID, RoleID) < 200000 then bool = false end if bool then if (TypeID == 8220401 or (TypeID >= 8220501 and TypeID <= 8220599)) then role.SetRoleSoul(MapID,InstanceID,RoleID,a-20,b) elseif (TypeID == 8220402 or (TypeID >= 8220601 and TypeID <= 8220699)) then role.SetRoleSoul(MapID,InstanceID,RoleID,a,b-20) end role.DecRoleSilver(MapID, InstanceID, RoleID, 200000, 452) local base = {} base[1] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33} base[2] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28} base[3] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15} local tbl = {ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8} local strength = 0 for i = 1,8 do if tbl[i] ~= nil and tbl[i] ~= 0 then local k = tbl[i]%10 if k == 0 then k =10 end strength = strength + k else break end end if strength > 80 then strength = 80 end local ability_num = 0 if strength < 8 then ability_num = math.random(1,strength) elseif strength <= 21 then ability_num = math.random(math.ceil(strength/10),6) if ability_num == 6 then if math.random(2) == 1 then ability_num = ability_num + 1 end end if ability_num == 7 then if math.random(5) > 4 then ability_num = ability_num + 1 end end else ability_num = math.random(math.ceil(strength/10),8) end local tbl_new = {} for i=1,ability_num do local k = math.random(6) if k>= 4 then local q = math.random(#base[1]) tbl_new[i] = 100000 + base[1][q] * 1000 + math.random(3) * 100 + 1 table.remove(base[1],q) elseif k>= 2 then local q = math.random(#base[2]) tbl_new[i] = 200000 + base[2][q] * 1000 + math.random(3) * 100 + 1 table.remove(base[2],q) else local q = math.random(#base[3]) tbl_new[i] = 300000 + base[3][q] * 1000 + math.random(3) * 100 + 1 table.remove(base[3],q) end end if strength - ability_num > 0 then for i = 1,strength-ability_num do local index = math.random(ability_num) if tbl_new[index] % 10 ~= 0 then tbl_new[index] = tbl_new[index] + 1 else if math.random(2) == 1 then for i = 1,ability_num do if tbl_new[i] % 10 ~= 0 then tbl_new[i] = tbl_new[i] + 1 break end end else for i = 0,ability_num-1 do if tbl_new[ability_num-i] % 10 ~= 0 then tbl_new[ability_num-i] = tbl_new[ability_num-i] + 1 break end end end end end end -----------------����Ϊ����꾧���ֵ���������������װ����ǿ�ȵĹ�ϵ-------------------------- if TypeID == 8220524 or TypeID == 8220527 or (TypeID >= 8220528 and TypeID <= 8220530) then return 1,ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8 elseif TypeID == 8220525 then for i = 1,4 do local r = math.random(10000) for w = 1,96 do temp = temp + gojijineng[w][2] if temp >= r then x = w break end end suiji[i] = gojijineng[x][1] end return 0, 101310, 313310, 120310, 121310, suiji[1], suiji[2], suiji[3], suiji[4] elseif TypeID == 8220526 then for i = 1,2 do local r = math.random(10000) for w = 1,96 do temp = temp + gojijineng[w][2] if temp >= r then x = w break end end suiji[i] = gojijineng[x][1] end return 0, 101310, 313310, 120310, 121310, 111310, 112310, suiji[1], suiji[2] else ------------------------����Ϊ��ͨ�꾧���ֵ���������������װ����ǿ�ȵĹ�ϵ------------------------ return 0,tbl_new[1],tbl_new[2],tbl_new[3],tbl_new[4],tbl_new[5],tbl_new[6],tbl_new[7],tbl_new[8] end else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 605020) msg.DispatchRoleMsgEvent(RoleID, MsgID) return 1,ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8 end end function x_OnUseItemType109(MapID, InstanceID, RoleID, TypeID, ObjID, High32, Low32) --- ����ߧߧ��� �ܧѧާߧ� �ߧѧ�ѧݧ� local levelup = role.GetEquipLvLimit(RoleID, High32, Low32) --- ��� ��ߧѧ��ԧ� if TypeID == 4999001 or TypeID == 5510002 then if levelup >= 1 and levelup <= 39 then --- 1-39 ��ߧѧ��ԧ� role.ResetEquipAtt(RoleID, High32, Low32) return 1 end end if TypeID == 4999002 or TypeID == 5510003 then if levelup >= 40 and levelup <= 59 then --- 40-59 ��ߧѧ��ԧ� role.ResetEquipAtt(RoleID, High32, Low32) return 1 end end if TypeID == 4999003 or TypeID == 5510004 then if levelup >= 60 and levelup <= 79 then --- 60-79 ��ߧѧ��ԧ� role.ResetEquipAtt(RoleID, High32, Low32) return 1 end end if TypeID == 4999004 or TypeID == 5510005 then if levelup >= 80 and levelup <= 99 then --- 80-99 ��ߧѧ��ԧ� role.ResetEquipAtt(RoleID, High32, Low32) return 1 end end if TypeID == 4999005 or TypeID == 5510006 then if levelup <= 120 then --- 110 �� �ߧڧا� role.ResetEquipAtt(RoleID, High32, Low32) return 1 end end if TypeID == 4999007 or TypeID == 4999008 then if levelup <= 120 then --- 120 �� �ߧڧا� role.ResetEquipAtt(RoleID, High32, Low32) return 1 end end ---����ߧߧ��� �ܧѧާߧ� �ܧ�ߧ֧� if ObjID < 8000000 then local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444501) --�ù���ֻ�ܶ�װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 else if (ObjID <= 8220699 and ObjID >= 8150101) or ObjID < 8140001 or (ObjID >= 8440564 and ObjID <= 8440659) or (ObjID >= 8039079 and ObjID <= 8039122) or (ObjID >= 9170110 and ObjID <= 9170117) or (ObjID >= 8000000 and ObjID <= 9999999) then--��װ�� --ÿ�����Ӳ���ǿ��װ����Ҫ�޸ĸñ�,����ǿ����װ����Ҫ����� local tbl = {8213207,8212207,8211207,8210207,8019001,8019002,8019004,8019005,8029001,8029002,8029004,8029005,8039001,8039002,8039004,8039005,8049001,8049002,8049004,8049005,8050908,8050909,8050910,8050911,8050914,8050915,8051908,8051909,8051910,8051911,8051914,8051915,8060908,8060909,8060910,8060911,8060914,8060915,8061908,8061909,8061910,8061911,8061914,8061915,8070908,8070909,8070910,8070911,8070914,8070915,8071908,8071909,8071910,8071911,8071914,8071915,8080908,8080909,8080910,8080911,8080914,8080915,8081908,8081909,8081910,8081911,8081914,8081915,8090908,8090909,8090910,8090911,8090914,8090915,8091908,8091909,8091910,8091911,8091914,8091915,8101315,8101316,8101317,8101318,8101319,8101320,8101321,8101322,8101327,8101328,8101329,8101330,8110710,8110711,8110912,8110913,8110920,8110921,8111912,8111913,8111920,8111921,8112001,8112002,8112003,8121709,8121710,8121908,8121909,8121912,8121913,8122908,8122909,8122912,8122913,8130915,8130916,8130917,8130918,8130923,8130924,8130925,8130926,8220001,8220201} local bool = true for k,v in pairs(tbl) do if v == ObjID then bool = false break end end if bool then if (TypeID >= 4820249 and TypeID <= 4820254) or TypeID == 4820258 or TypeID == 4820259 or (TypeID >= 4821001 and TypeID <= 4821002) or (TypeID >= 4820280 and TypeID <= 4820281) or (TypeID >= 4820287 and TypeID <= 4820288) or (TypeID >= 6600539 and TypeID <= 6600539) then local k = role.GetEquipStoneAddLevel(RoleID, High32, Low32) if k ~= nil then if TypeID == 4820249 or TypeID == 4820250 then if k < 8 then local p = {100,60,50,40,30,30,20,20} --��6�������Ҫ833�����ߣ���80�� local index = math.random(100) if 101 - index <= p[k+1] then role. SetEquipStoneAddLevel (RoleID, High32, Low32, k+1) else role. SetEquipStoneAddLevel (RoleID, High32, Low32, k-1) end return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444502) --�õ���ֻ�ܶ�8�����±�ʯ������װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end elseif TypeID == 4820251 or TypeID == 4820252 then if k < 8 then role. SetEquipStoneAddLevel (RoleID, High32, Low32, k+1) return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444502) --�õ���ֻ�ܶ�8�����±�ʯ������װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end elseif TypeID == 6600539 or TypeID == 6600539 then if k < 6 then local p = {90,90,90,90,90,90,0,0} --��6�������Ҫ833�����ߣ���80�� local index = math.random(100) if 101 - index <= p[k+1] then role. SetEquipStoneAddLevel (RoleID, High32, Low32, k+1) else role. SetEquipStoneAddLevel (RoleID, High32, Low32, k-1) end return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444502) --�õ���ֻ�ܶ�8�����±�ʯ������װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end elseif TypeID == 4820258 or TypeID == 4820259 then if k < 9 then role. SetEquipStoneAddLevel (RoleID, High32, Low32, k+1) return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444502) --�õ���ֻ�ܶ�8�����±�ʯ������װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end elseif TypeID == 4820253 or TypeID == 4820254 then if k < 10 then role. SetEquipStoneAddLevel (RoleID, High32, Low32, k+1) return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444503) --�õ���ֻ�ܶ�10�����±�ʯ������װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end elseif TypeID == 4821001 or TypeID == 4821002 then if k < 11 then role. SetEquipStoneAddLevel (RoleID, High32, Low32, k+1) return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444503) --�õ���ֻ�ܶ�10�����±�ʯ������װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end elseif TypeID == 4820280 or TypeID == 4820281 then if k < 12 then role. SetEquipStoneAddLevel (RoleID, High32, Low32, k+1) return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444503) --�õ���ֻ�ܶ�10�����±�ʯ������װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end elseif TypeID == 4820287 or TypeID == 4820288 then if k < 13 then role. SetEquipStoneAddLevel (RoleID, High32, Low32, k+1) return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444503) --�õ���ֻ�ܶ�10�����±�ʯ������װ��ʹ�� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end end end return 0 elseif TypeID >= 4820255 and TypeID <= 4820256 then local k = role.GetEquipGrowAttID(RoleID, High32, Low32) if k ~= nil then if k > 1000000 then local LevelNum = {} LevelNum[1100000] = {5,5,5,10,10,10,10,15,15,28,28} LevelNum[1200000] = {5,5,5,10,10,10,10,15,15,28,28} LevelNum[2100000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[2200000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[3100000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[3200000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[4100000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[4200000] = {14,14,14,14,14,19,19,19,19,26,26} LevelNum[5100000] = {5,5,5,5,5,11,10,10,10,10,10} LevelNum[5200000] = {5,5,5,5,5,11,10,10,10,10,10} LevelNum[6100000] = {5,5,5,5,5,11,10,10,10,10,10} LevelNum[6200000] = {5,5,5,5,5,11,10,10,10,10,10} LevelNum[7100000] = {6,7,6,6,6,6,5,10,10,10,10} LevelNum[7200000] = {6,7,6,6,6,6,5,10,10,10,10} LevelNum[7800000] = {0,0,0,0,0,0,16,16,16,16,16} LevelNum[8100000] = {0,0,0,0,0,0,0,0,0,10,10} LevelNum[8200000] = {0,0,0,0,0,0,0,0,0,10,10} LevelNum[8300000] = {0,0,0,0,0,0,0,0,0,10,10} local level = k%100 if(level == 0) then level = 10 end local type1 = k - k%100000 --����©����7100502�������Ҫ���⴦��--------------------------------- local growid = type1 + math.random(LevelNum[type1][level])*100 + level if growid == 7100502 then growid = 7100402 end ----------------------------------------------------------------------- role.SetEquipGrowAttID(RoleID, High32, Low32, growid) end return 1 end local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444504) --ֻ�ܶԾ��гɳ����Ե�װ��ʹ�ô˹��� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end return 0 else if (ObjID == 8213207 or ObjID == 8212207 or ObjID == 8211207 or ObjID == 8210207) and TypeID == 4800240 then local k = role.GetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"]) local times = role.GetRoleScriptData(RoleID, 1, RoleDataType["SDWI_Times"]) local baoshi = k%10 local shengyin = math.floor((k%1000)/10) local chengzhang = math.floor((k%100000)/1000) local baoshi_zengfu = role.GetEquipStoneAddLevel(RoleID, High32, Low32) local qianghua = role.GetEquipStrengthLevel(RoleID,High32, Low32) local gexp={24,48,72,96,120,144,192,240,312,528,768} local tbl_percent = {} tbl_percent[40] = {2,19,7,5,67} tbl_percent[60] = {2,19,7,5,67} tbl_percent[80] = {0,0,0,0,100} tbl_percent[90] = {0,60,0,0,40} tbl_percent[120] = {3,36,3,3,55} tbl_percent[150] = {0,39,3,0,58} tbl_percent[180] = {3,32,0,6,59} tbl_percent[230] = {0,52,0,2,46} tbl_percent[300] = {1,44,1,1,53} tbl_percent[330] = {0,0,0,0,100} local tbl_max = {} tbl_max[40] = {1,2,3,2,8} tbl_max[60] = {2,4,6,4,15} tbl_max[80] = {2,4,6,4,16} tbl_max[90] = {0,4,0,0,14} tbl_max[120] = {3,3,7,5,14} tbl_max[150] = {0,5,8,0,15} tbl_max[180] = {4,5,0,7,16} tbl_max[230] = {0,5,0,8,17} tbl_max[300] = {5,7,9,9,19} tbl_max[330] = {5,7,9,9,20} local tbl_index = {40,60,80,90,120,150,180,230,300,330} local index = 0 for i=1,10 do if tbl_index[i] > times then index = tbl_index[i] break end end if index ~= 0 then local q = 101 - math.random(100) local index_ = 5 local totle = 0 for i=1,5 do totle = totle + tbl_percent[index][i] if totle >= q then index_ = i break end end --[[local level = 0 local function GetSDWQlevel(n,baoshi,baoshi_zengfu,chengzhang,shengyin,qianghua) if n == 1 then return baoshi elseif n == 2 then return baoshi_zengfu elseif n == 3 then return chengzhang elseif n == 4 then return shengyin elseif n == 2 then return qianghua end end]] --level = GetSDWQlevel(index_,baoshi,baoshi_zengfu,chengzhang,shengyin,qianghua) if index_ == 1 and baoshi >= tbl_max[index][index_] then if chengzhang < tbl_max[index][3] then index_ = 3 elseif shengyin < tbl_max[index][4] then index_ = 4 else index_ = 5 end end if index_ == 3 and chengzhang >= tbl_max[index][index_] then if baoshi < tbl_max[index][1] then index_ = 1 elseif shengyin < tbl_max[index][4] then index_ = 4 else index_ = 5 end end if index_ == 4 and shengyin >= tbl_max[index][index_] then if chengzhang < tbl_max[index][3] then index_ = 3 elseif baoshi < tbl_max[index][1] then index_ = 1 else index_ = 5 end end if index_ == 1 then if baoshi < tbl_max[index][index_] then if ObjID == 8213207 or ObjID == 8212207 then role.PutStoneOnEquip(RoleID,High32, Low32, 3030014) else role.PutStoneOnEquip(RoleID,High32, Low32, 3030006) end role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+1) role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_Times"],times+1) end elseif index_ == 2 then if math.random(4) > 1 then if baoshi_zengfu < tbl_max[index][index_] then role. SetEquipStoneAddLevel (RoleID, High32, Low32, baoshi_zengfu+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10) else role. SetEquipStoneAddLevel (RoleID, High32, Low32, baoshi_zengfu-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10) end else if baoshi_zengfu > 0 then role. SetEquipStoneAddLevel (RoleID, High32, Low32, baoshi_zengfu-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10) else role. SetEquipStoneAddLevel (RoleID, High32, Low32, baoshi_zengfu+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10) end end role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_Times"],times+1) elseif index_ == 3 then if chengzhang < tbl_max[index][index_] then role.SetGrowEquipLevel(RoleID,High32, Low32,gexp[chengzhang+1]) role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+1000) role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_Times"],times+1) end elseif index_ == 4 then if shengyin < tbl_max[index][index_] then if ObjID == 8213207 or ObjID == 8212207 then role.SetEquipAdditionalAbility(RoleID,High32, Low32,3040023) else role.SetEquipAdditionalAbility(RoleID,High32, Low32,3040023) end role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10) role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_Times"],times+1) end elseif index_ == 5 then if math.random(5) > 1 then if qianghua < tbl_max[index][index_] then role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10000000) else role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10000000) end else if qianghua > 0 then role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10000000) else role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10000000) end end role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_Times"],times+1) end elseif times >= 330 then role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_Times"],times+1) local k_ = math.random(200) if k_ == 3 then if chengzhang < 11 then role.SetGrowEquipLevel(RoleID,High32, Low32,gexp[chengzhang+1]) role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+1000) else if qianghua < 17+math.random(3) then role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10000000) else role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10000000) end end elseif k_ == 4 then if shengyin < 10 then role.SetEquipAdditionalAbility(RoleID,High32, Low32,3040023) role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10) else if qianghua < 17+math.random(3) then role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10000000) else role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10000000) end end elseif k_ == 5 then if baoshi < 5 then if ObjID == 8213207 or ObjID == 8212207 then role.PutStoneOnEquip(RoleID,High32, Low32, 3030014) else role.PutStoneOnEquip(RoleID,High32, Low32, 3030006) end role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+1) else if qianghua < 17+math.random(3) then role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10000000) else role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10000000) end end elseif k_ > 140 then if baoshi_zengfu > 7 then role. SetEquipStoneAddLevel (RoleID, High32, Low32, baoshi_zengfu-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10) else role. SetEquipStoneAddLevel (RoleID, High32, Low32, baoshi_zengfu+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10) end else if qianghua < 17+math.random(3) then role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua+1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k+10000000) else role.SetEquipStrengthLevel(RoleID,High32, Low32,qianghua-1) --role.SetRoleScriptData(RoleID, 1, RoleDataType["SDWI_State"],k-10000000) end end end return 1 else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444505) --����ǿ����װ���޷�ʹ�ô˹��� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end end else local MsgID = msg.BeginMsgEvent() msg.AddMsgEvent(MsgID, 26, 444506) --ֻ�ܶ���ͨװ��ʹ�ô˹��� msg.DispatchRoleMsgEvent(RoleID, MsgID) return 0 end end end aux.RegisterRoleEvent(35, "x_RoleFAbaoLevelup") aux.RegisterRoleEvent(55, "x_RoleLianQi") aux.RegisterRoleEvent(48, "x_OnEquipConsolidateLevelUp") aux.RegisterRoleEvent(49, "x_OnProduceEquip") aux.RegisterRoleEvent(50, "x_OnEquipDigHole") aux.RegisterRoleEvent(51, "x_OnCutStone") aux.RegisterRoleEvent(53, "x_OnBrandEquip") --aux.RegisterRoleEvent(56, "x_OnUseBeGoldStone") aux.RegisterRoleEvent(80, "x_OnChooseGrowAtt")--װ���ɳ� aux.RegisterRoleEvent(81, "x_OnGetAnewStart") aux.RegisterWorldEvent(7, "x_OnSoulCrystal_GetZiZhi") aux.RegisterWorldEvent(8, "x_OnSoulCrystal_GetSkill") aux.RegisterWorldEvent(9, "x_OnSoulCrystal_GetAbility") --aux.RegisterRoleEvent(82, "x_OnSoulCrystal_GetZiZhi") --aux.RegisterRoleEvent(83, "x_OnSoulCrystal_GetSkill") --aux.RegisterRoleEvent(84, "x_OnSoulCrystal_GetAbility") aux.RegisterRoleEvent(86, "x_OnSoulCrystal_ResetAbility") aux.RegisterRoleEvent(89, "x_OnUseItemType109")