Sensuki
Arcane
Now I just need to figure out what the order of the bundle-inject command is
Can someone help me look for how to disable melee engagement altogether? I'll bet the gameplay would be a lot better without it because it makes melee combat an absolute clusterfuck.
edit: deleting the EngageEnemy method would probably do it.
public static void RunCommand(string command)
{
string str1 = command;
if (str1.ToLower() == "runcommand")
return;
List<string> list1 = new List<string>();
List<string> list2 = list1;
string str2 = str1;
char[] chArray = new char[1];
int index1 = 0;
int num = 32;
chArray[index1] = (char) num;
string[] strArray = str2.Split(chArray);
list2.AddRange((IEnumerable<string>) strArray);
foreach (MethodInfo methodInfo in typeof (CommandLine).GetMethods())
{
if (string.Compare(methodInfo.Name, list1[0], true) == 0)
{
ParameterInfo[] parameters1 = methodInfo.GetParameters();
if (parameters1 != null)
{
if (parameters1.Length > list1.Count - 1)
{
object[] objArray = new object[5];
int index2 = 0;
string str3 = "Command '";
objArray[index2] = (object) str3;
int index3 = 1;
string str4 = list1[0];
objArray[index3] = (object) str4;
int index4 = 2;
string str5 = "' requires ";
objArray[index4] = (object) str5;
int index5 = 3;
// ISSUE: variable of a boxed type
__Boxed<int> local = (System.ValueType) parameters1.Length;
objArray[index5] = (object) local;
int index6 = 4;
string str6 = " parameter(s).";
objArray[index6] = (object) str6;
Console.AddMessage(string.Concat(objArray), Color.get_yellow());
return;
}
else
{
object[] parameters2 = new object[parameters1.Length];
for (int index2 = 0; index2 < parameters1.Length; ++index2)
parameters2[index2] = (object) list1[index2 + 1];
methodInfo.Invoke((object) null, parameters2);
return;
}
}
else
{
methodInfo.Invoke((object) null, (object[]) null);
return;
}
}
}
foreach (MethodInfo methodInfo in typeof (Scripts).GetMethods())
{
if (string.Compare(methodInfo.Name, list1[0], true) == 0 && !Enumerable.Contains<string>((IEnumerable<string>) CommandLine.s_FinalProhibitedScripts, methodInfo.Name))
{
ParameterInfo[] parameters1 = methodInfo.GetParameters();
if (parameters1.Length > list1.Count - 1)
{
object[] objArray = new object[5];
int index2 = 0;
string str3 = "Script '";
objArray[index2] = (object) str3;
int index3 = 1;
string str4 = list1[0];
objArray[index3] = (object) str4;
int index4 = 2;
string str5 = "' requires ";
objArray[index4] = (object) str5;
int index5 = 3;
// ISSUE: variable of a boxed type
__Boxed<int> local = (System.ValueType) parameters1.Length;
objArray[index5] = (object) local;
int index6 = 4;
string str6 = " parameter(s).";
objArray[index6] = (object) str6;
Console.AddMessage(string.Concat(objArray), Color.get_yellow());
return;
}
else
{
object[] parameters2 = new object[parameters1.Length];
for (int index2 = 0; index2 < parameters1.Length; ++index2)
{
System.Type attributeType = (System.Type) CommandLine.s_ScriptAttributeTypes[index2];
object[] customAttributes = methodInfo.GetCustomAttributes(attributeType, false);
Scripts.BrowserType browserType = Scripts.BrowserType.None;
if (customAttributes.Length > 0)
browserType = (Scripts.BrowserType) attributeType.GetProperty("Browser").GetValue(customAttributes[0], (object[]) null);
ParameterInfo parameterInfo = parameters1[index2];
if (parameterInfo.ParameterType.IsEnum)
{
try
{
parameters2[index2] = Enum.Parse(parameterInfo.ParameterType, list1[index2 + 1]);
}
catch
{
parameters2[index2] = Enum.GetValues(parameterInfo.ParameterType).GetValue(0);
}
}
else
{
if (browserType != Scripts.BrowserType.ObjectGuid)
{
if (parameterInfo.ParameterType != typeof (Guid))
{
if (browserType == Scripts.BrowserType.Quest)
{
List<string> loadedQuests = QuestManager.Instance.FindLoadedQuests(list1[index2 + 1]);
if (loadedQuests.Count == 0)
{
parameters2[index2] = (object) list1[index2 + 1];
continue;
}
else if (loadedQuests.Count == 1)
{
parameters2[index2] = (object) loadedQuests[0];
continue;
}
else
{
Console.AddMessage("Multiple quests matched search '" + list1[index2 + 1] + "':", Color.get_yellow());
using (List<string>.Enumerator enumerator = loadedQuests.GetEnumerator())
{
while (enumerator.MoveNext())
Console.AddMessage(Path.GetFileNameWithoutExtension(enumerator.Current), Color.get_yellow());
return;
}
}
}
else if (browserType == Scripts.BrowserType.Conversation)
{
List<string> conversations = ConversationManager.Instance.FindConversations(list1[index2 + 1]);
if (conversations.Count == 0)
{
parameters2[index2] = (object) list1[index2 + 1];
continue;
}
else if (conversations.Count == 1)
{
parameters2[index2] = (object) conversations[0];
continue;
}
else
{
Console.AddMessage("Multiple conversations matched search '" + list1[index2 + 1] + "':", Color.get_yellow());
using (List<string>.Enumerator enumerator = conversations.GetEnumerator())
{
while (enumerator.MoveNext())
Console.AddMessage(Path.GetFileNameWithoutExtension(enumerator.Current), Color.get_yellow());
return;
}
}
}
else if (parameterInfo.ParameterType.IsValueType)
{
try
{
parameters2[index2] = Convert.ChangeType((object) list1[index2 + 1], parameterInfo.ParameterType);
continue;
}
catch (Exception ex)
{
object[] objArray = new object[7];
int index3 = 0;
string str3 = "Script error: could not convert parameter ";
objArray[index3] = (object) str3;
int index4 = 1;
// ISSUE: variable of a boxed type
__Boxed<int> local = (System.ValueType) (index2 + 1);
objArray[index4] = (object) local;
int index5 = 2;
string str4 = " ('";
objArray[index5] = (object) str4;
int index6 = 3;
string str5 = list1[index2];
objArray[index6] = (object) str5;
int index7 = 4;
string str6 = "') into type ";
objArray[index7] = (object) str6;
int index8 = 5;
string name = parameterInfo.ParameterType.Name;
objArray[index8] = (object) name;
int index9 = 6;
string str7 = ". ";
objArray[index9] = (object) str7;
Console.AddMessage(string.Concat(objArray), Color.get_yellow());
return;
}
}
else
{
parameters2[index2] = (object) list1[index2 + 1];
continue;
}
}
}
try
{
parameters2[index2] = (object) new Guid(list1[index2 + 1]);
}
catch
{
GameObject gameObject = GameObject.Find(list1[index2 + 1]);
if (Object.op_Implicit((Object) gameObject))
{
InstanceID instanceId = (InstanceID) gameObject.GetComponent<InstanceID>();
parameters2[index2] = !Object.op_Implicit((Object) instanceId) ? (object) Guid.Empty : (object) instanceId.Guid;
}
else
parameters2[index2] = (object) Guid.Empty;
}
}
}
methodInfo.Invoke((object) null, parameters2);
return;
}
}
}
Console.AddMessage("No command or script '" + list1[0] + "' exists.", Color.get_yellow());
}
public static void RunCommand(string command)
{
if (command.ToLower() == "runcommand")
return;
List<string> list1 = new List<string>();
List<string> list2 = list1;
string str1 = command;
char[] chArray = new char[1];
int index1 = 0;
int num = 32;
chArray[index1] = (char) num;
string[] strArray = str1.Split(chArray);
list2.AddRange((IEnumerable<string>) strArray);
foreach (MethodInfo methodInfo in Enumerable.Concat<MethodInfo>((IEnumerable<MethodInfo>) typeof (Scripts).GetMethods(), (IEnumerable<MethodInfo>) typeof (CommandLine).GetMethods()))
{
if (string.Compare(methodInfo.Name, list1[0], true) == 0 && !Enumerable.Contains<string>((IEnumerable<string>) CommandLine.s_FinalProhibitedScripts, methodInfo.Name))
{
ParameterInfo[] parameters1 = methodInfo.GetParameters();
if (parameters1 != null)
{
if (parameters1.Length > list1.Count - 1)
{
object[] objArray = new object[5];
int index2 = 0;
string str2 = "Command '";
objArray[index2] = (object) str2;
int index3 = 1;
string str3 = list1[0];
objArray[index3] = (object) str3;
int index4 = 2;
string str4 = "' requires ";
objArray[index4] = (object) str4;
int index5 = 3;
// ISSUE: variable of a boxed type
__Boxed<int> local = (System.ValueType) parameters1.Length;
objArray[index5] = (object) local;
int index6 = 4;
string str5 = " parameter(s).";
objArray[index6] = (object) str5;
Console.AddMessage(string.Concat(objArray), Color.get_yellow());
return;
}
else
{
object[] parameters2 = new object[parameters1.Length];
for (int index2 = 0; index2 < parameters1.Length; ++index2)
{
System.Type attributeType = (System.Type) CommandLine.s_ScriptAttributeTypes[index2];
object[] customAttributes = methodInfo.GetCustomAttributes(attributeType, false);
Scripts.BrowserType browserType = Scripts.BrowserType.None;
if (customAttributes.Length > 0)
browserType = (Scripts.BrowserType) attributeType.GetProperty("Browser").GetValue(customAttributes[0], (object[]) null);
ParameterInfo parameterInfo = parameters1[index2];
if (parameterInfo.ParameterType.IsEnum)
{
try
{
parameters2[index2] = Enum.Parse(parameterInfo.ParameterType, list1[index2 + 1]);
}
catch
{
parameters2[index2] = Enum.GetValues(parameterInfo.ParameterType).GetValue(0);
}
}
else
{
if (browserType != Scripts.BrowserType.ObjectGuid)
{
if (parameterInfo.ParameterType != typeof (Guid))
{
if (browserType == Scripts.BrowserType.Quest)
{
List<string> loadedQuests = QuestManager.Instance.FindLoadedQuests(list1[index2 + 1]);
if (loadedQuests.Count == 0)
{
parameters2[index2] = (object) list1[index2 + 1];
continue;
}
else if (loadedQuests.Count == 1)
{
parameters2[index2] = (object) loadedQuests[0];
continue;
}
else
{
Console.AddMessage("Multiple quests matched search '" + list1[index2 + 1] + "':", Color.get_yellow());
using (List<string>.Enumerator enumerator = loadedQuests.GetEnumerator())
{
while (enumerator.MoveNext())
Console.AddMessage(Path.GetFileNameWithoutExtension(enumerator.Current), Color.get_yellow());
return;
}
}
}
else if (browserType == Scripts.BrowserType.Conversation)
{
List<string> conversations = ConversationManager.Instance.FindConversations(list1[index2 + 1]);
if (conversations.Count == 0)
{
parameters2[index2] = (object) list1[index2 + 1];
continue;
}
else if (conversations.Count == 1)
{
parameters2[index2] = (object) conversations[0];
continue;
}
else
{
Console.AddMessage("Multiple conversations matched search '" + list1[index2 + 1] + "':", Color.get_yellow());
using (List<string>.Enumerator enumerator = conversations.GetEnumerator())
{
while (enumerator.MoveNext())
Console.AddMessage(Path.GetFileNameWithoutExtension(enumerator.Current), Color.get_yellow());
return;
}
}
}
else if (parameterInfo.ParameterType.IsValueType)
{
try
{
parameters2[index2] = Convert.ChangeType((object) list1[index2 + 1], parameterInfo.ParameterType);
continue;
}
catch (Exception ex)
{
object[] objArray = new object[7];
int index3 = 0;
string str2 = "Script error: could not convert parameter ";
objArray[index3] = (object) str2;
int index4 = 1;
// ISSUE: variable of a boxed type
__Boxed<int> local = (System.ValueType) (index2 + 1);
objArray[index4] = (object) local;
int index5 = 2;
string str3 = " ('";
objArray[index5] = (object) str3;
int index6 = 3;
string str4 = list1[index2];
objArray[index6] = (object) str4;
int index7 = 4;
string str5 = "') into type ";
objArray[index7] = (object) str5;
int index8 = 5;
string name = parameterInfo.ParameterType.Name;
objArray[index8] = (object) name;
int index9 = 6;
string str6 = ". ";
objArray[index9] = (object) str6;
Console.AddMessage(string.Concat(objArray), Color.get_yellow());
return;
}
}
else
{
parameters2[index2] = (object) list1[index2 + 1];
continue;
}
}
}
try
{
parameters2[index2] = (object) new Guid(list1[index2 + 1]);
}
catch
{
GameObject gameObject = GameObject.Find(list1[index2 + 1]);
if (Object.op_Implicit((Object) gameObject))
{
InstanceID instanceId = (InstanceID) gameObject.GetComponent<InstanceID>();
parameters2[index2] = !Object.op_Implicit((Object) instanceId) ? (object) Guid.Empty : (object) instanceId.Guid;
}
else
parameters2[index2] = (object) Guid.Empty;
}
}
}
methodInfo.Invoke((object) null, parameters2);
return;
}
}
}
}
Console.AddMessage("No command or script '" + list1[0] + "' exists.", Color.get_yellow());
}
}
Obsidian have also removed the additem function in this build. Probably my fault as I've been summoning items and revealing that Character Art is in a lot worse state than we expected / summoning cool looking items and posting them on the forums. I save every dll file from every build, so would someone be able to help me look for the code that restores the additem function ?
Code might be in the CommandLine class ... possibly the Scripts class ...
Obsidian have also removed the additem function in this build. Probably my fault as I've been summoning items and revealing that Character Art is in a lot worse state than we expected / summoning cool looking items and posting them on the forums.
Yeah, should be easy, let me see about that. Did they introduce it in this patch or was it already there in previous version?Can you figure out how to disable double click shifting the camera position? It's really annoying.
No, I can inject normal c# code with .Net Reflector. It's a bit tricky, but once you understand how to do it, the process is rather smooth.Are you writing your code in IL?
public static void BesterTest(string param1)
{
Console.AddMessage("Attempting to spawn: " + param1, UnityEngine.Color.yellow);
UnityEngine.GameObject besterCreature;
besterCreature = GameResources.LoadPrefab<UnityEngine.GameObject>(param1, true);
if (besterCreature != null)
Console.AddMessage("Spawned successfully!", UnityEngine.Color.green);
else
Console.AddMessage("Failed for some reason - probably bad naming.", UnityEngine.Color.red);
}