public ITES5ValueCodeChunk ConvertFunction(ITES5Referencer calledOn, TES4Function function, TES5CodeScope codeScope, TES5GlobalScope globalScope, TES5MultipleScriptsScope multipleScriptsScope) { /*string firstArg = function.Arguments[0].StringValue; * string md5 = TES5TypeFactory.TES4Prefix + "SCENE_" + PHPFunction.MD5(calledOn.ReferencesTo.ReferenceEDID + firstArg).Substring(0, 16); * List<string> sceneData = new List<string>() { md5, firstArg }; * if (function.Arguments.Count >= 2) * { * sceneData.Add(function.Arguments[1].StringValue); * } * this.metadataLogService.WriteLine("ADD_FORCEGREET_SCENE", sceneData); * ITES5Referencer reference = this.referenceFactory.createReference(md5, globalScope, multipleScriptsScope, codeScope.LocalScope); * TES5ObjectCallArguments funcArgs = new TES5ObjectCallArguments();*/ /* * Force start because in oblivion double using AddScriptPackage would actually overwrite the script package, so we mimic this * return this.objectCallFactory.createObjectCall(reference, "ForceStart", multipleScriptsScope, funcArgs); */ //WTM: Note: Even though I got some parts of LegacyStartConversation to work, I realized that Oblivion calls StartConversation with DIAL. //DIAL is not a type in Papyrus. The DIAL record would have to be converted to a Topic first somehow so StartConversation could be called. //I'm going to log calls to this function. /*TES4FunctionArguments oldArguments = function.Arguments; * TES5ObjectCallArguments newArguments = this.objectCallArgumentsFactory.CreateArgumentList(oldArguments, codeScope, globalScope, multipleScriptsScope); * return this.objectCallFactory.CreateObjectCall(calledOn, "LegacyStartConversation", newArguments);*/ return(logUnknownFunctionFactory.CreateLogCall(function)); }
public ITES5ValueCodeChunk ConvertFunction(ITES5Referencer calledOn, TES4Function function, TES5CodeScope codeScope, TES5GlobalScope globalScope, TES5MultipleScriptsScope multipleScriptsScope) { const string functionName = "SetCombatStyle"; TES4FunctionArguments functionArguments = function.Arguments; if (functionArguments.Count == 0) { return(logUnknownFunctionFactory.CreateLogCall(function)); } TES5ObjectCall getActorBase = this.objectCallFactory.CreateGetActorBase(calledOn); TES5ObjectCallArguments newArguments = this.objectCallArgumentsFactory.CreateArgumentList(functionArguments, codeScope, globalScope, multipleScriptsScope); return(this.objectCallFactory.CreateObjectCall(getActorBase, functionName, newArguments)); }
public ITES5ValueCodeChunk ConvertFunction(ITES5Referencer calledOn, TES4Function function, TES5CodeScope codeScope, TES5GlobalScope globalScope, TES5MultipleScriptsScope multipleScriptsScope) { TES4FunctionArguments tes4Arguments = function.Arguments; int statInt = ((TES4Integer)tes4Arguments[0]).IntValue; string statName; if (statInt == 14) { statName = "Horses Owned"; } else if (statInt == 15) { statName = "Houses Owned"; } else if (statInt == 16) { statName = "Stores Invested In"; } else if (statInt == 27) { statName = "Nirnroots Found"; } else { //Oblivion contains many calls to statInt = 19 (Artifacts Found) return(logUnknownFunctionFactory.CreateLogCall(function)); } TES5ObjectCallArguments arguments = new TES5ObjectCallArguments(); arguments.Add(new TES5String(statName)); if (tes4Arguments.Count > 1) { int modAmount = ((TES4Integer)tes4Arguments[1]).IntValue; arguments.Add(new TES5Integer(modAmount)); } return(objectCallFactory.CreateObjectCall(TES5StaticReferenceFactory.Game, "IncrementStat", arguments)); }