static bool Prefix(Humanoid __instance, Inventory inventory, ItemDrop.ItemData item, bool fromInventoryGui) { var data = item.GetRuneData(); if (data == null) { return(true); } if (inventory == null) { inventory = __instance.m_inventory; } if (RunicPower.IsOnCooldown(data)) { Player.m_localPlayer.Message(MessageHud.MessageType.Center, "[" + data.name + "] is not ready yet."); return(false); } if (!__instance.ConsumeItem(inventory, item)) { return(true); } var player = __instance as Player; new Rune(data, player).Cast(); return(false); }
private void UpdateValues() { StoreRuneEffects(); if (character?.IsPlayer() == true) { RunicPower.ClearCache(); } }
public static void Postfix(GuiScaler __instance, float scale) { if (scale == lastScale) { return; } lastScale = scale; RunicPower.Recreate(); }
private void Awake() { _this = this; UnsetMostThings(); LoadRunes(); LoadClasses(); SetupConfig(); configFile = Config; SpellsBar.RegisterKeybinds(); }
public static bool Prefix(ZNetScene __instance) { RunicPower.TryRegisterPrefabs(__instance); return(true); }
void Log(string message) { RunicPower.Debug(this.character.name + " " + message); }
public static void Postfix() { RunicPower.TryRegisterRecipes(); }
static void Prefix(FejdStartup __instance) { RunicPower.UnsetMostThings(); }
static bool Prefix(Console __instance) { string text = __instance.m_input.text; var parts = text.Split('='); if (parts.Length == 2) { var key = parts[0]; var value = parts[1]; var cvalue = new ConsoleValue(value); var keyparts = key.Split('.'); if (keyparts[0] != "rp") { vars[key] = cvalue; RunicPower.Recreate(); return(true); } var cmd = keyparts[1]; // ===== CASTING ================================================ if (cmd == "message") { RunicPower.CastingMessage message; if (cvalue.value == "global") { message = RunicPower.CastingMessage.GLOBAL; } else if (cvalue.value == "none") { message = RunicPower.CastingMessage.NONE; } else if (cvalue.value == "normal") { message = RunicPower.CastingMessage.NORMAL; } else if (cvalue.value == "self") { message = RunicPower.CastingMessage.SELF; } else { RunicPower.Log("CASTING.MESSAGE failed to change. Acceptable values are: global, none, normal, self"); return(true); } RunicPower.configCastingMessage.Value = message; RunicPower.Log("CASTING.MESSAGE config changed to " + message); } if (cmd == "cooldowns") { RunicPower.configCooldownsEnabled.Value = cvalue.boolvalue; RunicPower.Log("CASTING.COOLDOWNS config changed to " + cvalue.boolvalue); } if (cmd == "control") { RunicPower.configClassControl.Value = cvalue.intvalue; RunicPower.Log("CASTING.CONTROL config changed to " + cvalue.intvalue); } // ===== PVP ==================================================== if (cmd == "pvp") { RunicPower.configPvpEnabled.Value = cvalue.boolvalue; RunicPower.Log("PVP.ENABLED config changed to " + cvalue.boolvalue); } // ===== SPELLSBAR ============================================== if (cmd == "pos") { RunicPower.InvBarPosition pos; if (cvalue.value == "top") { pos = RunicPower.InvBarPosition.TOP; } else if (cvalue.value == "bottom") { pos = RunicPower.InvBarPosition.BOTTOM; } else { RunicPower.Log("INVBAR.POS failed to change. Acceptable values are: top, bottom"); return(true); } RunicPower.configInvBarPosition.Value = pos; RunicPower.Log("INVBAR.POS config changed to " + cvalue.value); } // ===== HOTKEYS BAR ============================================ if (cmd == "hotkey") { RunicPower.configHotkeysEnabled.Value = cvalue.boolvalue; RunicPower.Log("HOTKEY.ENABLED config changed to " + cvalue.boolvalue); } if (cmd == "scale") { RunicPower.configHotkeysScale.Value = cvalue.intvalue; RunicPower.Log("HOTKEY.SCALE config changed to " + cvalue.intvalue); } if (cmd == "x") { RunicPower.configHotkeysOffsetX.Value = cvalue.intvalue; RunicPower.Log("HOTKEY.OFFSETX config changed to " + cvalue.intvalue); } if (cmd == "y") { RunicPower.configHotkeysOffsetY.Value = cvalue.intvalue; RunicPower.Log("HOTKEY.OFFSETY config changed to " + cvalue.intvalue); } if (cmd == "modifier") { RunicPower.KeyModifiers mod; if (cvalue.value == "shift") { mod = RunicPower.KeyModifiers.SHIFT; } else if (cvalue.value == "control" || cvalue.value == "ctrl" || cvalue.value == "ctr") { mod = RunicPower.KeyModifiers.CTRL; } else if (cvalue.value == "alt") { mod = RunicPower.KeyModifiers.ALT; } else { RunicPower.Log("HOTKEY.MODIFIER failed to change. Acceptable values are: shift, control, alt"); return(true); } RunicPower.configHotkeysModifier.Value = mod; RunicPower.Log("HOTKEY.MODIFIER config changed to " + mod); } // ===== INTERFACE ============================================== if (cmd == "craftall") { RunicPower.configsCraftAllEnabled.Value = cvalue.boolvalue; RunicPower.Log("INTERFACE.CRAFTALL config changed to " + cvalue.boolvalue); } if (cmd == "ranktabs") { RunicPower.configRanksTabEnabled.Value = cvalue.boolvalue; RunicPower.Log("INTERFACE.RANKTABS config changed to " + cvalue.boolvalue); } if (cmd == "rankx") { RunicPower.configRanksOffsetX.Value = cvalue.intvalue; RunicPower.Log("RANKS.OFFSETX config changed to " + cvalue.intvalue); } if (cmd == "ranky") { RunicPower.configRanksOffsetY.Value = cvalue.intvalue; RunicPower.Log("RANKS.OFFSETY config changed to " + cvalue.intvalue); } // ===== DEBUG ================================================== if (cmd == "debug") { RunicPower.debug = cvalue.boolvalue; RunicPower.Log("DEBUG config changed to " + cvalue.boolvalue); } RunicPower.configFile.Save(); RunicPower.Recreate(); return(false); } return(true); }