thorpedosg

isChhaYa

Aug 7th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. private void applyEffect_77(ArrayList cibles, Fight fight)
  2. {
  3. int value = 1;
  4. try
  5. {
  6. value = Integer.parseInt(_args.split(";")[0]);
  7. }catch(NumberFormatException e){};
  8. int num = 0;
  9. for(Fighter target : cibles)
  10. {
  11. int val = Formulas.getPointsLost('m', value, _caster, target);
  12. if(val < value)
  13. {
  14. SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(fight, 7, 309, _caster.getGUID()+"", target.getGUID()+","+(value-val));
  15. }
  16. if(val < 1)continue;
  17. target.addBuff(Constants.STATS_REM_PM, val, _turns,0, true, _spell,_args,_caster, _debuffable);
  18. SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(fight, 7,Constants.STATS_REM_PM, _caster.getGUID()+"", target.getGUID()+",-"+val+","+_turns);
  19. num += val;
  20. //Gain de PM pendant le tour de jeu
  21. if(target.canPlay() && target == _caster) target.setCurPM(fight, target.getPM()+val);
  22.  
  23. }
  24. if(num != 0)
  25. {
  26. SocketManager.GAME_SEND_GA_PACKET_TO_FIGHT(fight, 7,Constants.STATS_ADD_PM, _caster.getGUID()+"", _caster.getGUID()+","+num+","+_turns);
  27. _caster.addBuff(Constants.STATS_ADD_PM, num, _turns, _turns, true, _spell,_args,_caster, _debuffable);
  28. _caster.setCurPM(fight, _caster.getPM() + num);
  29. }
  30. }
Add Comment
Please, Sign In to add comment