View difference between Paste ID: Mmdy6A24 and NQ5ZvJwJ
SHOW: | | - or go back to the newest paste.
1-
	public void tryCaC(Personnage perso, int cellID) {
1+
	public void tryCaC(Player perso, int cellID)
2
	{
3-
3+
4-
		if (caster == null) {
4+
		
5
		if(caster == null)return;
6
		
7-
7+
		if(_ordreJeu.get(_curPlayer).getGUID() != caster.getGUID())//Si ce n'est pas a lui de jouer
8-
		if (_ordreJeu.get(_curPlayer).getGUID() != caster.getGUID())//Si ce n'est pas a lui de jouer
8+
9
		
10
		if(perso.getObjetByPos(Constants.ITEM_POS_ARME) == null)//S'il n'a pas de CaC
11
		{
12-
12+
			tryCastSpell(caster, World.getSort(0).getStatsByLevel(1), cellID);
13-
		if (perso.getObjetByPos(Constants.ITEM_POS_ARME) == null)//S'il n'a pas de CaC
13+
		}else
14
		{
15-
			if (_curFighterPA < 4)//S'il n'a pas assez de PA
15+
			Item arme = perso.getObjetByPos(Constants.ITEM_POS_ARME);
16
			
17
			//Pierre d'âmes = EC
18
			if(arme.getTemplate().getType() == 83)
19-
19+
20-
			SocketManager.GAME_SEND_GAS_PACKET_TO_FIGHT(this, 7, perso.get_GUID());
20+
				SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 305, perso.getGUID()+"", "");//Echec Critique Cac
21-
21+
				SocketManager.GAME_SEND_GAF_PACKET_TO_FIGHT(this, 7, 0, perso.getGUID());//Fin de l'action
22-
			//Si le joueur est invisible
22+
				try{
23-
			if (caster.isHide()) {
23+
24-
				caster.unHide(-1);
24+
				}catch(Exception e){}
25
				endTurn();
26-
26+
27-
			Fighter target = _map.getCase(cellID).getFirstFighter();
27+
			
28-
28+
29-
			SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 303, perso.get_GUID() + "", cellID + "");
29+
			
30-
30+
			if(_curFighterPA < PACost)//S'il n'a pas assez de PA
31-
			if (target != null) {
31+
32-
				int dmg = Formulas.getRandomJet("1d5+0");
32+
				
33-
				//et pour les item type feu eau agi ?
33+
34-
				int finalDommage = Formulas.calculFinalDommage(this, caster, target, Constants.ELEMENT_NEUTRE, dmg, false, true, -1);
34+
35-
				finalDommage = SpellEffect.applyOnHitBuffs(finalDommage, target, caster, this);//S'il y a des buffs sp�ciaux
35+
			SocketManager.GAME_SEND_GAS_PACKET_TO_FIGHT(this, 7, perso.getGUID());
36-
36+
37-
				if (finalDommage > target.getPDV()) {
37+
			if(isEc)
38-
					finalDommage = target.getPDV();//Target va mourrir
38+
39
				GameServer.addToLog(perso.getName()+" Echec critique sur le CaC ");
40-
				target.removePDV(finalDommage);
40+
				SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 305, perso.getGUID()+"", "");//Echec Critique Cac
41-
				finalDommage = -(finalDommage);
41+
				SocketManager.GAME_SEND_GAF_PACKET_TO_FIGHT(this, 7, 0, perso.getGUID());//Fin de l'action
42-
				SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 100, caster.getGUID() + "", target.getGUID() + "," + finalDommage);
42+
43
			}else
44-
			_curFighterPA -= 4;
44+
45-
			SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 102, perso.get_GUID() + "", perso.get_GUID() + ",-4");
45+
				SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 303, perso.getGUID()+"", cellID+"");
46-
			SocketManager.GAME_SEND_GAF_PACKET_TO_FIGHT(this, 7, 0, perso.get_GUID());
46+
47-
47+
				if(isCC)
48-
			if (target.getPDV() <= 0) {
48+
				{
49-
				onFighterDie(target, target);
49+
					GameServer.addToLog(perso.getName()+" Coup critique sur le CaC");
50
					SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 301, perso.getGUID()+"", "0");
51-
			verifIfTeamAllDead();
51+
52-
		} else {
52+
				
53-
			Objet arme = perso.getObjetByPos(Constants.ITEM_POS_ARME);
53+
54-
54+
				if(caster.isHide())caster.unHide();
55-
			//Pierre d'�mes = EC
55+
				
56-
			if (arme.getTemplate().getType() == 83) {
56+
57-
				SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 305, perso.get_GUID() + "", "");//Echec Critique Cac
57+
				if(isCC)
58-
				SocketManager.GAME_SEND_GAF_PACKET_TO_FIGHT(this, 7, 0, perso.get_GUID());//Fin de l'action
58+
				{
59-
				try {
59+
60
				}
61-
				} catch (Exception e) {
61+
				for(SpellEffect SE : effets)
62
				{
63
					if(_state != Constants.FIGHT_STATE_ACTIVE)break;
64
					ArrayList<Fighter> cibles = Pathfinding.getCiblesByZoneByWeapon(this,arme.getTemplate().getType(),_map.getCase(cellID),caster.getFightCell().getID());
65-
65+
66
					SE.applyToFight(this, caster, cibles);
67-
67+
68-
			if (_curFighterPA < PACost)//S'il n'a pas assez de PA
68+
				_curFighterPA-= PACost;
69
				SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(this, 7, 102,perso.getGUID()+"",perso.getGUID()+",-"+PACost);
70-
70+
				SocketManager.GAME_SEND_GAF_PACKET_TO_FIGHT(this, 7, 0, perso.getGUID());
71
				verifIfTeamAllDead();
72
			}
73-
			SocketManager.GAME_SEND_GAS_PACKET_TO_FIGHT(this, 7, perso.get_GUID());
73+
74-
74+