Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // IA du percepteur
- // IA => apply_typePerco()
- // Remplacer par :
- private static void apply_typePerco(Fighter F, Fight fight)
- {
- int notWhile = 0;
- try
- {
- do
- {
- notWhile++;
- if (notWhile >= 12) stop = true;
- if (notWhile > 15) return;
- Fighter T = getNearestEnnemy(fight, F);
- if(T == null) return;
- int attack = attackIfPossiblePerco(fight,F);
- if(attack != 0)//Attaque
- {
- if(attack == 5) stop = true;//EC
- if(!moveFarIfPossible(fight, F))//fuite
- {
- if(!HealIfPossiblePerco(fight,F,false))//soin allié
- {
- if(!buffIfPossiblePerco(fight,F,T))//buff allié
- {
- if(!HealIfPossiblePerco(fight,F,true))//auto-soin
- {
- if(!buffIfPossiblePerco(fight,F,F))//auto-buff
- {
- stop = true;
- }
- }
- }
- }
- }
- }
- if(stop) break;
- }while(F.canPlay());
- }catch(Exception e)
- {
- return;
- }
- }
- // Faire droper le percepteur,et droper le joueur
- // Percepteur => Percepteur(),Fight => getGE()
- // Remplacer par :
- //Percepteur Importe les array:
- public ArrayList<Drop> getDrops() {
- ArrayList<Drop> toReturn = new ArrayList<World.Drop>();
- for(Objet obj : _objets.values()) {
- toReturn.add(new Drop(obj.getTemplate().getID(),0, 100, obj.getQuantity()));
- }
- return toReturn;
- }
- //Fight après le for de //Calcul des drops possibles
- if(_type == Constants.FIGHT_TYPE_PVT)
- {
- minkamas = (int)_perco.getKamas() / TEAM1.size();
- maxkamas = minkamas;
- possibleDrops.addAll(_perco.getDrops());
- }
- // Attaque du perco
- // IA => attackIfPossiblePerco()
- // Tous remplacer
- private static int attackIfPossiblePerco(Fight fight, Fight.Fighter fighter)
- {
- Map<Integer,Fighter> ennemyList = getLowHpEnnemyList(fight,fighter);
- SortStats SS = null;
- Fighter target = null;
- for(Entry<Integer, Fighter> t : ennemyList.entrySet())
- {
- SS = getBestSpellForTargetPerco(fight, fighter, (Fight.Fighter)t.getValue());
- if (SS == null)
- continue;
- target = (Fight.Fighter)t.getValue();
- break;
- }
- int curTarget = 0; int cell = 0;
- Sort.SortStats SS2 = null;
- for (Entry<Integer, SortStats> S : World.getGuild(fighter.getPerco().GetPercoGuildID()).getSpells().entrySet())
- {
- if (S.getValue() != null) {
- int targetVal = getBestTargetZone(fight, fighter, (Sort.SortStats)S.getValue(), fighter.get_fightCell().getID());
- if ((targetVal == -1) || (targetVal == 0))
- continue;
- int nbTarget = targetVal / 1000;
- int cellID = targetVal - nbTarget * 1000;
- if (nbTarget <= curTarget)
- continue;
- curTarget = nbTarget;
- cell = cellID;
- SS2 = (Sort.SortStats)S.getValue();
- }
- }
- if ((curTarget > 0) && (cell > 0) && (cell < 480) && (SS2 != null))
- {
- int attack = fight.tryCastSpell(fighter, SS2, cell);
- if (attack != 0)
- return attack;
- }
- else
- {
- if ((target == null) || (SS == null))
- return 666;
- int attack = fight.tryCastSpell(fighter, SS, target.get_fightCell().getID());
- if (attack != 0)
- return attack;
- }
- return 0;
- }
- // Hmm je croit que c'est bon ;)
- // Tous à été tester
Advertisement
Add Comment
Please, Sign In to add comment