public void ui_ingame_createInterface() { PlayerData_Self Self = e.getWorld().Player_Self; //Do things like setting character stats screen, actionbar skills, etc based on info sent from server for character ActionbarButtons[0].setSkill(Skills.SkillList[0]); if (Self.ActiveQuests != null) { foreach (QuestData q in Self.ActiveQuests) { QuestTracker.AddQuest(q); } } QuestPopup.setPlayerRef(Self); ui_ingame_updatePlayerFrame(); }
public void combat_attemptCastSkill(BaseSkill s) { bool validTargetEnemy = false; bool validTargetFriendly = false; bool validTargetSelf = false; if (State == COMBAT_STATE.STATE_DEAD) { e.getUI().ui_ingame_DisplayError("You are dead."); return; } else if (onGlobalCooldown) { e.getUI().ui_ingame_DisplayError("You can't cast that yet."); return; } else if (s.onCooldown) { e.getUI().ui_ingame_DisplayError("That skill isn't ready yet."); return; } else if (CombatTarget != null) { // if(CombatTarget.isNPC) // { if (CombatTarget.Faction == AI_Faction.Hostile) { if (s.allowedTargets.Contains(Skill_Targets.Enemy)) { validTargetEnemy = true; } else if (s.allowedTargets.Contains(Skill_Targets.Self)) { validTargetSelf = true; } else { e.getUI().ui_ingame_DisplayError("Invalid target."); return; } //Enemy target and non-friendly spell } else if (CombatTarget.Faction == AI_Faction.Friendly || CombatTarget.Faction == AI_Faction.Neutral) { if (s.allowedTargets.Contains(Skill_Targets.Enemy)) { e.getUI().ui_ingame_DisplayError("You can't attack that target."); return; } else if (s.allowedTargets.Contains(Skill_Targets.Friendly)) { validTargetFriendly = true; } else if (s.allowedTargets.Contains(Skill_Targets.Self)) { validTargetSelf = true; } //Enemy target and non-friendly spell } // } // else // { // e.getUI().ui_ingame_DisplayError("Invalid target."); // return; // } } else { e.getUI().ui_ingame_DisplayError("Invalid target."); return; } if (e.getWorld().Player_Self.Energy < s.energyCost) { e.getUI().ui_ingame_DisplayError("Not enough mana."); return; } if (validTargetFriendly || validTargetEnemy) { e.StartCoroutine(combat_globalCooldownStart()); e.getNetwork().net_sendCastSpell(CombatTarget.uniqueID, s.skillID); //e.getWorld().world_castSpellFromPlayer(); } else if (validTargetSelf) { e.StartCoroutine(combat_globalCooldownStart()); e.getNetwork().net_sendCastSpell(e.getWorld().Player_Self.PlayerID, s.skillID); } //combat_castSkill(validTargetEnemy, validTargetFriendly, validTargetSelf); }
private void net_onAskDeleteCharacterResponse(NetworkMessage netMsg) { S2GC_CharacterDeleteResponse Message = netMsg.ReadMessage <S2GC_CharacterDeleteResponse>(); if (Message.errorCode == -1) { net_sendAskCharacterList(e.getWorld().Self_ID); } else { Client.Disconnect(); e.getUI().ui_login_Disconnected("Something went wrong..."); } }