137 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
		
		
			
		
	
	
			137 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
|  | /* | ||
|  | 文件名:GetCurrentModuleDamageRate.nut | ||
|  | 路径:character/GetCurrentModuleDamageRate.nut | ||
|  | 创建日期:2022-11-12	19:42 | ||
|  | 文件用途:提升伤害 | ||
|  | */ | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  | //获取强化增幅提升率 | ||
|  | function SetUpgradeRate() { | ||
|  |     local Rate = [ | ||
|  |         [0, 1.0], | ||
|  |         [1, 1.02], | ||
|  |         [2, 1.03], | ||
|  |         [3, 1.04], | ||
|  |         [4, 1.05], | ||
|  |         [5, 1.06], | ||
|  |         [6, 1.07], | ||
|  |         [7, 1.08], | ||
|  |         [8, 1.09], | ||
|  |         [9, 1.10], | ||
|  |         [10, 1.10], | ||
|  |         [11, 1.20], | ||
|  |         [12, 1.40], | ||
|  |         [13, 1.60], | ||
|  |         [14, 2.20], | ||
|  |         [15, 3.40], | ||
|  |     ]; | ||
|  |     local RootTable = getroottable(); | ||
|  |     local Level = L_sq_GetCharacterAttribute(0x1054, 1); | ||
|  |     RootTable.rawset("UpgradeRate", Rate[Level][1] - 1.0); | ||
|  | } | ||
|  | 
 | ||
|  | //最终伤害 | ||
|  | function GetOverDamgeRate(obj) { | ||
|  |     return (obj.sq_GetIntData(169, 1).tofloat() / 100.0); | ||
|  | } | ||
|  | 
 | ||
|  | //-------------------------------------------------------------------------------------------------黄字追加伤害 | ||
|  | function GetYellowAddDamageRate(obj) { | ||
|  |     local YellowAdd = obj.getVar("YellowAdd"); | ||
|  |     YellowAdd.clear_vector(); | ||
|  |     local YellowAddRate = YellowAdd.getInt(0); //黄字追加伤害初始值 | ||
|  | 
 | ||
|  |     //----------------------------------------------------------------------------技能栏手搓伤害增加率 | ||
|  |     local SkillSlot = obj.getVar("SkillSlot"); | ||
|  |     local SkillSlotRate = (12 - SkillSlot.getInt(0)) * 5; | ||
|  |     YellowAdd.setInt(0, SkillSlotRate); | ||
|  |     //---------------------------------------------------------------------------- | ||
|  | 
 | ||
|  |     return YellowAddRate; | ||
|  | } | ||
|  | //-------------------------------------------------------------------------------------------------黄字追加伤害 | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  | function getCurrentModuleDamageRate(obj) { | ||
|  | 
 | ||
|  |     if (!obj) | ||
|  |         return 1.0; | ||
|  |     local rate = 10.0; | ||
|  | 
 | ||
|  |     local UpgradeRate = getroottable()["UpgradeRate"]; | ||
|  |     rate += (GetYellowAddDamageRate(obj).tofloat() / 100.0); //追加黄字 | ||
|  | 
 | ||
|  |     //强化增伤  //最终增伤 | ||
|  |     //rate *= 1 + UpgradeRate + GetOverDamgeRate(obj); | ||
|  |     return rate; | ||
|  | } | ||
|  | 
 | ||
|  | if (!getroottable().rawin("DungeonIndex")) DungeonIndex <- []; | ||
|  | if (!getroottable().rawin("GrowType")) GrowType <- []; | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  | function L_getCurrentModuleDamageRate(obj) { | ||
|  |     if (!obj) | ||
|  |         return 1.0; | ||
|  |     local rate; | ||
|  |     if (getroottable().rawin("LenheartCurrentModuleDamageRate")) { | ||
|  |         rate = 1.0 + getroottable()["LenheartCurrentModuleDamageRate"]; | ||
|  |     } else { | ||
|  |         rate = 1.0; | ||
|  |     } | ||
|  |     local AncientAttackHit = obj.getVar("AncientAttackHit"); | ||
|  |     local AncientAttackRate = AncientAttackHit.getInt(10).tofloat() / 1000.0; | ||
|  | 
 | ||
|  |     local ClientRat = 1.0; | ||
|  |     try { | ||
|  |         ClientRat = getCurrentModuleDamageRate(obj).tofloat(); | ||
|  |     } catch (exception) { | ||
|  |         ClientRat = 1.0; | ||
|  |     } | ||
|  | 
 | ||
|  |     local stage = sq_GetGlobaludpModuleStage(); | ||
|  |     local dungeon = sq_GetDungeonByStage(stage); | ||
|  |     local dungeonIndex = sq_GetDuegonIndex(dungeon); | ||
|  |     local fbsh = 100; | ||
|  | 
 | ||
|  |     foreach(id in DungeonIndex) { | ||
|  |         if (dungeonIndex == id[0]) { | ||
|  |             fbsh = id[1]; | ||
|  |         } | ||
|  |     } | ||
|  |     local nrate = fbsh.tofloat() / 100.0; | ||
|  |     rate = rate.tofloat() * nrate; | ||
|  | 
 | ||
|  |     local LLJob = sq_getJob(obj); | ||
|  |     local LLGrowT = sq_getGrowType(obj); | ||
|  | 
 | ||
|  |     local LLLen = GrowType.len(); | ||
|  |     for (local i = 0; i< 11; ++i) { | ||
|  |         if (i == LLLen) break; | ||
|  |         if (LLJob == i) { | ||
|  |             foreach(GR in GrowType[i]) { | ||
|  |                 if (LLGrowT == GR[0]) | ||
|  |                     rate = rate.tofloat() * GR[1].tofloat(); | ||
|  |             } | ||
|  |         } | ||
|  | 
 | ||
|  |     } | ||
|  | 
 | ||
|  |     return (rate * ClientRat) + AncientAttackRate; | ||
|  | } | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  | 
 | ||
|  | function GetMyDamageRateByLenheart(Chunk) { | ||
|  |     local Jso = Json.Decode(Chunk); | ||
|  |     local str = Jso.sh; | ||
|  | 
 | ||
|  |     local Func = compilestring(str); | ||
|  |     Func(); | ||
|  | } | ||
|  | Pack_Control.rawset(20058002, GetMyDamageRateByLenheart); |