public override bool UseItem(Humanoid user, ItemDrop.ItemData item) { var name = item.m_dropPrefab.name; if (GoodsList.ContainsKey(name)) { var gd = GoodsList[name]; if (item.m_stack >= gd.Value) { var goodItemData = OdinItem.GetItemData(gd.Good); if (user.GetInventory().AddItem(goodItemData)) { user.GetInventory().RemoveItem(item, gd.Value); Say(goodItemData.m_shared.m_description); return(true); } DBG.InfoCT("$op_inventory_full"); return(true); } Say("$op_shaman_notenough"); return(true); } Say("$op_shaman_no"); return(true); }
public void FocreAttack() { if (Plugin.KS_SecondInteractkey.Value.IsDown()) { var __instance = Player.m_localPlayer; Vector3 aimDir = __instance.GetAimDir(Vector3.zero); Ray ray = new Ray(GameCamera.instance.transform.position, GameCamera.instance.transform.forward); int layerMask = Pathfinding.instance.m_layers | Pathfinding.instance.m_waterLayers; RaycastHit raycastHit; Physics.Raycast(ray, out raycastHit, 500f, layerMask); Vector3 point = raycastHit.point; if (PetManager.Indicator.activeSelf) { PetManager.Indicator.SetActive(false); // Pet.Indicator.transform.SetParent(PrefabsParent.transform); Traverse.Create(this.GetComponent <MonsterAI>()).Field("m_targetStatic").SetValue(null); DBG.InfoCT("Stop pet attack"); //trans return; } PetManager.Indicator.SetActive(true); // if (__instance.GetHoverCreature() != null) // { // Pet.Indicator.transform.SetParent(__instance.GetHoverCreature().transform); // } PetManager.Indicator.transform.position = raycastHit.point; ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.Everybody, "ChatMessage", new object[] { raycastHit.point, 3, "attack here!", "" }); Traverse.Create(this.GetComponent <MonsterAI>()).Field("m_targetStatic").SetValue(PetManager.Indicator.GetComponent <StaticTarget>()); DBG.InfoCT("Pet force attack"); //trans return; } }
public void RPC_CreateQuestFailed(long sender) { CancelWaitError(); DBG.InfoCT("Try Agian,the dice is broken"); DBG.blogError(string.Format("Cannot Place Quest : {0}", WaitQuest.locName, WaitQuest.m_type)); WaitQuest = null; }
public static void SummonPet(string name) { var ppfb = ZNetScene.instance.GetPrefab(name); var go = Instantiate(ppfb, Player.m_localPlayer.transform.position + Player.m_localPlayer.transform.forward * 2f + Vector3.up, Quaternion.identity); go.GetComponent <Character>().SetLevel(4); DBG.InfoCT("You summoned a " + name); //trans }
public bool CanCreateQuest() { if (WaitQuest != null) { DBG.InfoCT("$op_quest_failed_wait"); return(false); } return(true); }
public override void Init() { if (!PickItem()) { DBG.InfoCT("Clear some search Quest then Come back"); //upd Failed process return; } quest.locName = m_count.ToString() + m_item; quest.m_range = 0; Begin(); }
public void SetText(string text) { int num; if (int.TryParse(text, out num)) { if (!QuestManager.instance.GiveUpQuest(num)) { DBG.InfoCT("$op_munin_noq " + num); return; } return; } DBG.InfoCT("$op_wrong_num"); return; }
private static void Prefix(Chat __instance) { if (Player.m_localPlayer != null && OdinPlus.isNPCInit) { string cmd = __instance.m_input.text; if (cmd.ToLower() == "/odinhere") { if (Set_FOP) { LocationManager.GetStartPos(); return; } NpcManager.Root.transform.localPosition = Player.m_localPlayer.transform.localPosition + Vector3.forward * 4; } if (cmd.ToLower() == "/whereami") { var pos = Player.m_localPlayer.transform.position; string s = pos.x + "," + pos.y + "," + pos.z; DBG.InfoCT(s); DBG.cprt(s); //global::Console.instance.m_input.text=s; __instance.m_input.text = s; return; } if (cmd.ToLower() == "/whereodin") { var pos = NpcManager.Root.transform.localPosition; string s = pos.x + "," + pos.y + "," + pos.z; DBG.InfoCT(s); DBG.cprt(s); __instance.m_input.text = s; return; } if (cmd.ToLower() == "/setodin") { CFG_OdinPosition.Value = NpcManager.Root.transform.localPosition; return; } if (cmd.ToLower() == "/findfarm") { Game.instance.DiscoverClosestLocation("WoodFarm1", Player.m_localPlayer.transform.position, "Village", 0); return; } } }
//HELP how to make a delegate here?//notice public void OnOpen(Humanoid user, bool hold) { if (hold) { return; } if (user.GetHoverName() == m_ownerName) { var quest = QuestManager.instance.GetQuest(m_id); if (quest != null) { //upd should select in base? yes!!!!!!!!! QuestProcesser.Create(quest).Finish(); return; } //upd giveup without destroy? } string n = string.Format("Hey you found the chest belong to <color=yellow><b>{0}</b></color>", m_ownerName); //trans DBG.InfoCT(n); }
public void OnDeath() { if (Player.GetClosestPlayer(transform.position, 100).GetHoverName() == m_ownerName) { QuestManager.instance.GetQuest(ID).Finish(); } else { if (m_ownerName == "") { } else { string n = string.Format("Hey you found the chest belong to <color=yellow><b>{0}</b></color>", m_ownerName); //trans DBG.InfoCT(n); } } Tweakers.ValSpawn("vfx_GodExplosion", transform.position); var r = Instantiate(ZNetScene.instance.GetPrefab("OdinLegacy"), transform.localPosition, Quaternion.identity); r.GetComponent <ItemDrop>().m_itemData.m_quality = Key; r.GetComponent <ItemDrop>().m_itemData.m_stack = Level; }
void OnDestroyed() { PetManager.Indicator.SetActive(false); PetManager.TrollIns = null; DBG.InfoCT(Localization.instance.Localize(this.GetComponent <Humanoid>().m_name + " died")); //trans }
private void ShowWaitError() { DBG.InfoCT("There maybe something wrong with the server,please try again later"); }