超级玩家
 
- 贡献度
- 0
- 金元
- 7643
- 积分
- 764
- 精华
- 0
- 注册时间
- 2014-12-6
|
| NewStatValue = 10; weapSlot = 1; StatsModifiers = {'ElectrocutedApplicationRate'}; cumulativeMode = true; P = Game.GetPlayer(); SSC = Game.GetScriptableSystemsContainer(); TS = Game.GetTransactionSystem(); SS = Game.GetStatsSystem(); ES = SSC:Get(CName.new('EquipmentSystem')); PD = ES:GetPlayerData(P); PD['GetItemInEquipSlot2'] = PD['GetItemInEquipSlot;gamedataEquipmentAreaInt32']; ID = PD:GetItemInEquipSlot2('Weapon', weapSlot - 1); print('\n ') for i, StatName in next, StatsModifiers do if ID.tdbid.hash == 0 then print(' \n\t[ SLOT '..weapSlot..' ]\t->\tNO WEAPON FOUND IN THIS SLOT\n ') elseif ID.tdbid.hash ~= 0 then itemData = TS:GetItemData(P, ID); SOID = itemData:GetStatsObjectID(); local currVal = SS:GetStatValue(SOID, StatName); local itemID = TDBID.ToStringDEBUG(ID.id); local itemName = Game.GetLocalizedTextByKey(TDB.GetLocKey(TDBID.ToStringDEBUG(ID.id..'.displayName'))); local MinVal = TweakDB:GetFlat('BaseStats.'..StatName..'.min'); local MaxVal = TweakDB:GetFlat('BaseStats.'..StatName..'.max'); print('\t[ Slot '..weapSlot..' ]\t->\t'..itemName..'\t( "'..itemID..'" )') print('\t'..StatName..'\t->\tMIN Settable value : '..string.format('%f', MinVal)) print('\t'..StatName..'\t->\tMAX Settable value : '..string.format('%f', MaxVal)) print('\t'..StatName..'\t->\tCURRENT STAT VALUE : '..string.format('%f', currVal)) if cumulativeMode then newValue = currVal + NewStatValue; statMod = Game['gameRPGManager::CreateStatModifier;gamedataStatTypegameStatModifierTypeFloat'](StatName, 'Additive', newValue) print('\t . . . Adding : '..string.format('%f', NewStatValue)) else statMod = Game['gameRPGManager::CreateStatModifier;gamedataStatTypegameStatModifierTypeFloat'](StatName, 'Additive', NewStatValue) print('\t . . . setting : '..string.format('%f', NewStatValue)) end SS:RemoveAllModifiers(SOID, StatName, true) SS:AddSavedModifier(SOID, statMod) local newCurrVal = SS:GetStatValue(SOID, StatName); print('\t'..StatName..'\t->\tNEW STAT VALUE: '..string.format('%f', newCurrVal)..'\n ') end end |
| NewStatValue = 10; weapSlot = 1; StatsModifiers = {'ElectrocutedApplicationRate'}; cumulativeMode = true; P = Game.GetPlayer(); SSC = Game.GetScriptableSystemsContainer(); TS = Game.GetTransactionSystem(); SS = Game.GetStatsSystem(); ES = SSC:Get(CName.new('EquipmentSystem')); PD = ES:GetPlayerData(P); PD['GetItemInEquipSlot2'] = PD['GetItemInEquipSlot;gamedataEquipmentAreaInt32']; ID = PD:GetItemInEquipSlot2('Weapon', weapSlot - 1); print('\n ') for i, StatName in next, StatsModifiers do if ID.tdbid.hash == 0 then print(' \n\t[ SLOT '..weapSlot..' ]\t->\tNO WEAPON FOUND IN THIS SLOT\n ') elseif ID.tdbid.hash ~= 0 then itemData = TS:GetItemData(P, ID); SOID = itemData:GetStatsObjectID(); local currVal = SS:GetStatValue(SOID, StatName); local itemID = TDBID.ToStringDEBUG(ID.id); local itemName = Game.GetLocalizedTextByKey(TDB.GetLocKey(TDBID.ToStringDEBUG(ID.id..'.displayName'))); local MinVal = TweakDB:GetFlat('BaseStats.'..StatName..'.min'); local MaxVal = TweakDB:GetFlat('BaseStats.'..StatName..'.max'); print('\t[ Slot '..weapSlot..' ]\t->\t'..itemName..'\t( "'..itemID..'" )') print('\t'..StatName..'\t->\tMIN Settable value : '..string.format('%f', MinVal)) print('\t'..StatName..'\t->\tMAX Settable value : '..string.format('%f', MaxVal)) print('\t'..StatName..'\t->\tCURRENT STAT VALUE : '..string.format('%f', currVal)) if cumulativeMode then newValue = currVal + NewStatValue; statMod = Game['gameRPGManager::CreateStatModifier;gamedataStatTypegameStatModifierTypeFloat'](StatName, 'Additive', newValue) print('\t . . . Adding : '..string.format('%f', NewStatValue)) else statMod = Game['gameRPGManager::CreateStatModifier;gamedataStatTypegameStatModifierTypeFloat'](StatName, 'Additive', NewStatValue) print('\t . . . setting : '..string.format('%f', NewStatValue)) end SS:RemoveAllModifiers(SOID, StatName, true) SS:AddSavedModifier(SOID, statMod) local newCurrVal = SS:GetStatValue(SOID, StatName); print('\t'..StatName..'\t->\tNEW STAT VALUE: '..string.format('%f', newCurrVal)..'\n ') end end |
|
|