Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

OdinMS Upgraded Beta PvP!

Status
Not open for further replies.
Junior Spellweaver
Joined
Jul 14, 2008
Messages
130
Reaction score
2
alright, first of all, credits to airflow for developing OdinMS Base PvP

alright, everyones going to hate this PvP. it doesnt use mysql anymore..

and, im not going to tell u anymore about it... read the code ureself

Tutorial

First, make a file called MaplePvp.java in net.sf.odinms.net.channel.handler

(ignore this step if u already have the file)

Second, if u have the file from previous occasions replace it with the following code. If u just added the file, add the following code.

Code:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package net.sf.odinms.net.channel.handler;

import java.util.Collections;

import net.sf.odinms.client.ISkill;
import net.sf.odinms.client.MapleCharacter;
import net.sf.odinms.client.SkillFactory;

import net.sf.odinms.server.life.MapleMonster;
import net.sf.odinms.server.life.MapleLifeFactory;
import net.sf.odinms.net.world.guild.MapleGuild;
import net.sf.odinms.server.MaplePortal;
import net.sf.odinms.client.MapleBuffStat;
import net.sf.odinms.net.channel.ChannelServer;
import net.sf.odinms.server.maps.MapleMap;
import net.sf.odinms.tools.MaplePacketCreator;

public class MaplePvp {
        //default values, don't change these
        private static int pvpDamage;
        private static int min;
        private static int maxDis;
        private static int matk;
        private static int watk;
        private static int luk;
        private static int maxHeight;
        private static boolean isAoe;
        public static boolean isLeft = false;
        public static boolean isRight = false;
        private static boolean magic = false;
        private static boolean magicrecovery = false;
        private static boolean magicguard = false;
        private static boolean mesguard = false;
        private static void pvpDamageBalance(AbstractDealDamageHandler.AttackInfo attack, MapleCharacter player) {
        matk = player.getTotalMagic();
        luk = player.getTotalLuk();
        watk = player.getTotalWatk();
        matk = player.getTotalMagic();
        double mastery = 0;
        double multi = 0;
        int skill = 0;
        ISkill skil;
                switch (attack.skill) {
                        case 0: //normal attack
                            pvpDamage = player.getCurrentMaxBaseDamage();
                            min = player.calculateMinBaseDamage(watk, player);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1001004:    //Power Strike
                            skil = SkillFactory.getSkill(1001004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = skil.getEffect(skill).getDamage() / 100.0;
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1001005:    //Slash Blast
                            skil = SkillFactory.getSkill(1001004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = skil.getEffect(skill).getDamage() / 100.0;
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 2001004:    //Energy Bolt
                            skil = SkillFactory.getSkill(2001004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = skil.getEffect(skill).getMatk();
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 200;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 2001005:    //Magic Claw
                            skil = SkillFactory.getSkill(2001005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 3001004:    //Arrow Blow
                            skil = SkillFactory.getSkill(3001004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 3001005:    //Double Shot
                            skil = SkillFactory.getSkill(3001005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4001334:    //Double Stab
                            skil = SkillFactory.getSkill(4001334);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4001344:    //Lucky Seven
                            skil = SkillFactory.getSkill(4001344);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int)(5 * luk / 100 * watk * multi);
                            min = (int)(2.5 * luk / 100 * watk * multi);
                            player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 2101004:    //Fire Arrow
                            skil = SkillFactory.getSkill(4101004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 400;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 2101005:    //Poison Brace
                            skil = SkillFactory.getSkill(2101005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 400;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 2201004:    //Cold Beam
                            skil = SkillFactory.getSkill(2201004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 300;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 2301005:    //Holy Arrow
                            skil = SkillFactory.getSkill(2301005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 300;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 4101005:    //Drain
                            skil = SkillFactory.getSkill(4101005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4201005:    //Savage Blow
                            skil = SkillFactory.getSkill(4201005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1111004:    //Panic: Axe
                            skil = SkillFactory.getSkill(1111004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1111003:    //Panic: Sword
                            skil = SkillFactory.getSkill(1111003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1311004:    //Dragon Fury: Pole Arm
                            skil = SkillFactory.getSkill(1311004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1311003:    //Dragon Fury: Spear
                            skil = SkillFactory.getSkill(1311003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1311002:    //Pole Arm Crusher
                            skil = SkillFactory.getSkill(1311002);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1311005:    //Sacrifice
                            skil = SkillFactory.getSkill(1311005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1311001:    //Spear Crusher
                            skil = SkillFactory.getSkill(1311001);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 2211002:    //Ice Strike
                             skil = SkillFactory.getSkill(2211002);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 250;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 2211003:    //Thunder Spear
                             skil = SkillFactory.getSkill(2211003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 300;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 3111006:    //Strafe
                            skil = SkillFactory.getSkill(3111006);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) Math.floor(Math.random() * (player.calculateMaxBaseDamage(watk) * multi));
                            maxDis = 450;
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 3211006:    //Strafe
                            skil = SkillFactory.getSkill(3211006);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4111005:    //Avenger
                            skil = SkillFactory.getSkill(4111005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4211002:    //Assaulter
                            skil = SkillFactory.getSkill(4211002);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 200;
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1121008:    //Brandish
                            skil = SkillFactory.getSkill(1121008);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1121006:    //Rush
                            skil = SkillFactory.getSkill(1121006);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1221009:    //Blast
                            skil = SkillFactory.getSkill(1221009);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1221007:    //Rush
                            skil = SkillFactory.getSkill(1221007);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 1321003:    //Rush
                            skil = SkillFactory.getSkill(1321003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 2121003:    //Fire Demon
                             skil = SkillFactory.getSkill(2121003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 400;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 2221006:    //Chain Lightning
                             skil = SkillFactory.getSkill(2221006);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 400;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 2221003:    //Ice Demon
                             skil = SkillFactory.getSkill(2221003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 400;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 2321007:    //Angel's Ray
                             skil = SkillFactory.getSkill(2321007);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                               mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 400;
                            maxHeight = 35;
                            isAoe = false;
                            magic = true;
                                break;
                        case 3121003:    //Dragon Pulse
                            skil = SkillFactory.getSkill(3121003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 3121004:    //Hurricane
                            skil = SkillFactory.getSkill(3121004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 3221003:    //Dragon Pulse       
                            skil = SkillFactory.getSkill(3221003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 3221001:    //Piercing
                            skil = SkillFactory.getSkill(3221003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 3221007:    //Sniping
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * 3);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * 3);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4121003:    //Showdown taunt
                            skil = SkillFactory.getSkill(4121003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4121007:    //Triple Throw
                            skil = SkillFactory.getSkill(4121007);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4221007:    //Boomerang Step
                            skil = SkillFactory.getSkill(4221007);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        case 4221003:    //Showdown taunt
                            skil = SkillFactory.getSkill(4221003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = false;
                                break;
                        //aoe
                        case 2201005:    //Thunderbolt
                            skil = SkillFactory.getSkill(2201005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 250;
                            maxHeight = 250;
                            isAoe = true;
                            magic = true;
                                break;
                        case 3101005:    //Arrow Bomb : Bow
                            skil = SkillFactory.getSkill(3101005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 250;
                            isAoe = true;
                                break;
                        case 3201005:    //Iron Arrow : Crossbow
                            skil = SkillFactory.getSkill(3201005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = true;
                                break;
                        case 1111006:    //Coma: Axe
                            skil = SkillFactory.getSkill(1111006);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 250;
                            isAoe = true;
                                break;
                        case 1111005:    //Coma: Sword
                            skil = SkillFactory.getSkill(1111005);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 250;
                            isAoe = true;
                                break;
                        case 1211002:    //Charged Blow - skill doesn't work
                            skil = SkillFactory.getSkill(1211002);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 250;
                            isAoe = true;
                                break;
                        case 1311006:    //Dragon Roar
                            skil = SkillFactory.getSkill(1311006);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 600;
                            maxHeight = 450;
                            isAoe = true;
                                break;
                        case 2111002:    //Explosion
                            skil = SkillFactory.getSkill(2111002);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 350;
                            maxHeight = 350;
                            isAoe = true;
                            magic = true;
                                break;
                        case 2111003:    //Poison Mist
                            skil = SkillFactory.getSkill(2111003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 350;
                            maxHeight = 350;
                            isAoe = true;
                            magic = true;
                                break;
                        case 2311004:    //Shining Ray
                            skil = SkillFactory.getSkill(2311004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 350;
                            maxHeight = 350;
                            isAoe = true;
                            magic = true;
                                break;
                        case 3111004:    //Arrow Rain
                            skil = SkillFactory.getSkill(3111004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 350;
                            maxHeight = 350;
                            isAoe = true;
                                break;
                        case 3111003:    //Inferno
                            skil = SkillFactory.getSkill(3111003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 350;
                            maxHeight = 350;
                            isAoe = true;
                                break;
                        case 3211004:    //Arrow Eruption
                            skil = SkillFactory.getSkill(3211004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 350;
                            maxHeight = 350;
                            isAoe = true;
                                break;
                        case 3211003:    //Blizzard (Sniper)
                            skil = SkillFactory.getSkill(3211003);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 350;
                            maxHeight = 350;
                            isAoe = true;
                                break;
                        case 4211004:    //Band of Thieves Skill doesn't work so i don't know
                            skil = SkillFactory.getSkill(4211004);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 350;
                            isAoe = true;
                                break;
                        case 1221011:    //Sanctuary Skill doesn't work so i don't know
                            skil = SkillFactory.getSkill(1221011);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 350;
                            maxHeight = 350;
                            isAoe = true;
                                break;
                        case 2121001:    //Big Bang
                            skil = SkillFactory.getSkill(2121001);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 175;
                            maxHeight = 175;
                            isAoe = true;
                            magic = true;
                                break;
                        case 2121007:    //Meteo
                            skil = SkillFactory.getSkill(2121007);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 600;
                            maxHeight = 600;
                            isAoe = true;
                            magic = true;
                                break;
                        case 2121006:    //Paralyze
                            skil = SkillFactory.getSkill(2121006);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 250;
                            maxHeight = 250;
                            isAoe = true;
                            magic = true;
                                break;
                        case 2221001:    //Big Bang
                            skil = SkillFactory.getSkill(2221001);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 175;
                            maxHeight = 175;
                            isAoe = true;
                            magic = true;
                                break;
                        case 2221007:    //Blizzard
                            skil = SkillFactory.getSkill(2221007);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 600;
                            maxHeight = 600;
                            isAoe = true;
                            magic = true;
                                break;
                        case 2321008:    //Genesis
                            skil = SkillFactory.getSkill(2321008);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 600;
                            maxHeight = 600;
                            isAoe = true;
                            magic = true;
                                break;
                        case 2321001:   //bishop Big Bang
                            skil = SkillFactory.getSkill(2321001);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getMatk());
                                mastery = skil.getEffect(skill).getMastery() * 5 + 10 / 100;
                            }
                            pvpDamage = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8);
                            min = (int) ((matk * 0.8) + (luk / 4) / 18 * multi * 0.8 * mastery);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = 175;
                            maxHeight = 175;
                            isAoe = true;
                            magic = true;
                                break;
                        case 4121004:    //Ninja Ambush
                            pvpDamage = (int) Math.floor(Math.random() * (180 - 150) + 150);
                            maxDis = 150;
                            maxHeight = 300;
                            isAoe = true;
                                break;
                        case 4121008:    //Ninja Storm knockback
                            skil = SkillFactory.getSkill(4121008);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) Math.floor(Math.random() * (player.calculateMaxBaseDamage(watk) * multi));
                            maxDis = 150;
                            maxHeight = 35;
                            isAoe = true;
                                break;
                        case 4221001:    //Assassinate
                            skil = SkillFactory.getSkill(4221001);
                            skill = player.getSkillLevel(skil);
                            if(skill > 0){
                                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                            }
                            pvpDamage = (int) (player.calculateMaxBaseDamage(watk) * multi);
                            min = (int) (player.calculateMinBaseDamage(watk, player) * multi);
                            pvpDamage = player.rand(min, pvpDamage);
                            maxDis = player.getMaxDis(player);
                            maxHeight = 35;
                            isAoe = true;
                                break;
                        case 4221004:    //Ninja Ambush
                            pvpDamage = (int) Math.floor(Math.random() * (180 - 150) + 150);
                            maxDis = 150;
                            maxHeight = 150;
                            isAoe = true;
                                break;
                        default:
                            break;
                }
        }

         private static void getDirection(AbstractDealDamageHandler.AttackInfo attack) {
                if (isAoe) {
                        isRight = true;
                        isLeft = true;
                } else if (attack.direction <= 0 && attack.stance <= 0) {
                        isRight = false;
                        isLeft = true;
                } else {
                        isRight = true;
                        isLeft = false;
                }
        }
        
        private static void monsterBomb(MapleCharacter player, MapleCharacter attackedPlayers, MapleMap map, AbstractDealDamageHandler.AttackInfo attack) {
            //combo start
                double multi = 0;
                int skill = 0;
                ISkill skil;
                Integer combo = player.getBuffedValue(MapleBuffStat.COMBO);
                if(combo != null) {
                player.handleOrbgain();
                skil = SkillFactory.getSkill(1120003);
                skill = player.getSkillLevel(skil);
                if(skill > 0){
                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                pvpDamage *= multi;
                }
                else {
                skil = SkillFactory.getSkill(1120003);
                skill = player.getSkillLevel(skil);
                multi = (skil.getEffect(player.getSkillLevel(skil)).getDamage() / 100.0);
                pvpDamage *= multi;
                }
                }
                //combo end
                //summon check

                //summon end
                //damage balances
                if (attackedPlayers.getLevel() < player.getLevel()) { 
                int difference = player.getLevel() - attackedPlayers.getLevel();
                if(difference >= 5) {
                pvpDamage /= player.getLevel() / 5;
                }
                }
                pvpDamage -= (attackedPlayers.getTotalWdef() * 1.5);
                if(pvpDamage < 0) {
                    pvpDamage = 1;
                }
                //damage balances end
                //buff modifiers **magic guard and mesoguard**
        Integer mguard = attackedPlayers.getBuffedValue(MapleBuffStat.MAGIC_GUARD);
        Integer mesoguard = attackedPlayers.getBuffedValue(MapleBuffStat.MESOGUARD);
        if (mguard != null) {
            skil = SkillFactory.getSkill(2001002);
            skill = attackedPlayers.getSkillLevel(skil);
            if(skill > 0){
                multi = (skil.getEffect(attackedPlayers.getSkillLevel(skil)).getX() / 100.0);
            }
            int mg = (int) (pvpDamage * multi);
            if(attackedPlayers.getMp() > mg) {
                attackedPlayers.setMp(attackedPlayers.getMp() - mg);
                pvpDamage -= mg;
            }
            else {
                pvpDamage -= attackedPlayers.getMp();
                attackedPlayers.setMp(0);
                attackedPlayers.getClient().getSession().write(MaplePacketCreator.serverNotice(5,"Your MP has been drained."));
            }
            magicguard = true;
        }
        if (mesoguard != null) { 
            skil = SkillFactory.getSkill(4211005);
            skill = attackedPlayers.getSkillLevel(skil);
            if(skill > 0){
                multi = (skil.getEffect(attackedPlayers.getSkillLevel(skil)).getX() / 100.0);
            }
            int mg = (int) (pvpDamage * multi);
            if(attackedPlayers.getMeso() > mg) {
                attackedPlayers.gainMeso(-mg, false);
                pvpDamage *= 0.5;
            }
            else {
                attackedPlayers.getClient().getSession().write(MaplePacketCreator.serverNotice(5,"You do not have enough mesos to weaken the blow"));
            }
            mesguard = true;
        }
        //end of buffs
        //passive skills
        int y = 3;
        int skillid;
        int aPmp;
        if(magic) {
        for (int i = 0; i<y; i++) {
            skillid = 100000 * i + 2000000;
            skil = SkillFactory.getSkill(skillid);
            skill = attackedPlayers.getSkillLevel(skil);
            if(skill > 0){
                multi = (skil.getEffect(attackedPlayers.getSkillLevel(skil)).getX() / 100.0);
                if(skil.getEffect(attackedPlayers.getSkillLevel(skil)).makeChanceResult()) {
                    aPmp = (int) (multi * attackedPlayers.getMaxMp());
                    if (attackedPlayers.getMp() > aPmp) {
                        attackedPlayers.setMp(attackedPlayers.getMp() - aPmp);
                        player.setMp(player.getMp() + aPmp);
                        if (player.getMp() > player.getMaxMp()) {
                            player.setMp(player.getMaxMp());
                        }
                    }
                    else 
                    {
                        player.setMp(player.getMp() + attackedPlayers.getMp());
                        if (player.getMp() > player.getMaxMp()) {
                            player.setMp(player.getMaxMp());
                        }
                        attackedPlayers.setMp(0);
                    }
                }
            }
            }
        magic = false;
        magicrecovery = true;
        }
        //passive skills end
        //skills effects
        
        //skills effects end
                //the bomb
                MapleMonster pvpMob = MapleLifeFactory.getMonster(9400711);
                map.spawnMonsterOnGroudBelow(pvpMob, attackedPlayers.getPosition());
                player.getClient().getSession().write(player.makeHPBarPacket(attackedPlayers));
                //number of damage packets
                        for (int dmgpacket = 0; dmgpacket < attack.numDamage; dmgpacket++) {
                        map.broadcastMessage(player, MaplePacketCreator.damagePlayer(attack.numDamage, pvpMob.getId(), attackedPlayers.getId(), pvpDamage), false);
                        player.getClient().getSession().write(MaplePacketCreator.damagePlayer(attack.numDamage, pvpMob.getId(), attackedPlayers.getId(), pvpDamage));
                        attackedPlayers.addHP(-pvpDamage);
                        try{
                        Thread.sleep(200);
                        }
                        catch(Exception e)
                        {
                        }
                }
                int attackedDamage = pvpDamage * attack.numDamage;
                attackedPlayers.getClient().getSession().write(MaplePacketCreator.serverNotice(5, player.getName() + " has done " + attackedDamage + " damage to you!"));
                player.getClient().getSession().write(player.makeHPBarPacket(attackedPlayers));
                //announcements
                if(magicguard) {
                    player.getClient().getSession().write(MaplePacketCreator.serverNotice(5, player.getName() + " has partially blocked your attack with magic guard!"));
                    magicguard = false;
                }
                if(mesguard) {
                    player.getClient().getSession().write(MaplePacketCreator.serverNotice(5, player.getName() + " has partially blocked your attack with mesoguard!"));
                    mesguard = false;
                }
                if(magicrecovery) {
                    attackedPlayers.getClient().getSession().write(MaplePacketCreator.serverNotice(5, player.getName() + " has partially absorbed your MP with MP Eater!"));
                    magicrecovery = false;
                }
                //announcements end
                //rewards
                if (attackedPlayers.getHp() <= 0 && !attackedPlayers.isAlive()) {
                        // exp bonuses
                        int expreward = attackedPlayers.getLevel() * 100;
                        player.setHp(player.getMaxHp());
                        player.setMp(player.getMaxMp());
                        if (player.getPvpKills() / 4 >= player.getPvpDeaths()) {
                                expreward *= 2;
                        }
                        //exp
                        if(attackedPlayers.getExp() > 0) {
                        expreward *= (attackedPlayers.getExp() / attackedPlayers.getLevel());
                        }
                        player.gainExp(expreward, true, false);
                        //guild points
                        if (player.getGuildId() != 0 && player.getGuildId() != attackedPlayers.getGuildId()) {
                                try {
                                        MapleGuild guild = player.getClient().getChannelServer().getWorldInterface().getGuild(player.getGuildId(), null);
                                        guild.gainGP(1);
                                } catch (Exception e) {}
                        }
                        if (attackedPlayers.getGuildId() != 0 && attackedPlayers.getGuildId() != player.getGuildId()) {
                                try {
                                        MapleGuild guild = attackedPlayers.getClient().getChannelServer().getWorldInterface().getGuild(attackedPlayers.getGuildId(), null);
                                        guild.gainGP(-1);
                                } catch (Exception e) {}
                        }
                        //guild points end
                        //pvpkills and deaths
                        player.gainPvpKill();
                        player.getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You've killed " + attackedPlayers.getName() + "! You've gained a kill!"));
                        attackedPlayers.gainPvpDeath();
                        attackedPlayers.getClient().getSession().write(MaplePacketCreator.serverNotice(6, player.getName() + " has killed you!"));
                        //pvp end kills and deaths
                        //delay
                        try{
                        Thread.sleep(500);
                        }
                        catch(Exception e)
                        {
                        }
                        attackedPlayers.getClient().getSession().write(MaplePacketCreator.serverNotice(6, "You have been reborn."));
                        //delay end
                        //reborn dead person and warp somewhere
                        ChannelServer cserv = player.getClient().getChannelServer();
                        MapleMap target = cserv.getMapFactory().getMap(100000000);//map to be reborn
                        MaplePortal targetportal = target.getPortal(0);
                        attackedPlayers.setHp(attackedPlayers.getMaxHp());
                        attackedPlayers.setMp(attackedPlayers.getMaxMp());
                        attackedPlayers.gainExp(attackedPlayers.getExp() / -10, true, false);
                        if(attackedPlayers.getExp() < 0) {
                            attackedPlayers.gainExp(attackedPlayers.getExp() + attackedPlayers.getExp() * -1, true, false);
                        }
                        attackedPlayers.changeMap(target, targetportal);
                }
                map.killMonster(pvpMob, player, false);
        }

        public static void doPvP(MapleCharacter player, MapleMap map, AbstractDealDamageHandler.AttackInfo attack) {
                pvpDamageBalance(attack, player); //grab height/distance/damage/aoetrue\false
                getDirection(attack);
                for (MapleCharacter attackedPlayers : player.getMap().getNearestPvpChar(player.getPosition(), maxDis, maxHeight, Collections.unmodifiableCollection(player.getMap().getCharacters()))) {
                        if (attackedPlayers.isAlive() && (player.getParty() == null || player.getParty() != attackedPlayers.getParty())) {
                                monsterBomb(player, attackedPlayers, map, attack);
                                player.getMap().movePlayer(attackedPlayers, player.getPosition());
                        }
                }
        }
}

then go into MapleCharacter.java

add
Code:
private transient int wdef, mdef;

under
Code:
private transient int magic, watk;

then add
Code:
        private double sword;
        private double blunt;
        private double axe;
        private double spear;
        private double polearm;
        private double claw;
        private double dagger;
        private double staffwand = 0.1;
        private double crossbow;
        private double bow;
        private int skill = 0;
        private ISkill skil;
        private int maxDis;
        
        private int pvpDeaths = 1;
        private int pvpKills = 0;

under

Code:
	private int nxcash;
	private int maplepoints;
	private int gifttokens;
	private boolean incs;

then add
Code:
wdef = 0;
mdef = 0;

under
Code:
private void recalcLocalStats() {
		int oldmaxhp = localmaxhp;
		localmaxhp = getMaxHp();
		localmaxmp = getMaxMp();
		localdex = getDex();
		localint_ = getInt();
		localstr = getStr();
		localluk = getLuk();
		int speed = 100;
		int jump = 100;
                if(getId() == 30000) {
                    speed = 210;
                    jump = 130;
                }
		magic = localint_;
		watk = 0;

then in the same function... add in the right place.. not that hard.

Code:
wdef += equip.getWdef();
mdef += equip.getMdef();

alright.. then add
Code:
        public int getMaxDis(MapleCharacter player) {
        IItem weapon_item = player.getInventory(MapleInventoryType.EQUIPPED).getItem((byte) -11);
        if(weapon_item != null) {
            MapleWeaponType weapon = MapleItemInformationProvider.getInstance().getWeaponType(weapon_item.getItemId());
            if(weapon == MapleWeaponType.SPEAR || weapon == MapleWeaponType.POLE_ARM) {
                maxDis = 106;
            }
            if(weapon == MapleWeaponType.DAGGER || weapon == MapleWeaponType.SWORD1H || weapon == MapleWeaponType.AXE1H || weapon == MapleWeaponType.BLUNT1H) {
                maxDis = 63;
            }
            if(weapon == MapleWeaponType.SWORD2H || weapon == MapleWeaponType.AXE1H || weapon == MapleWeaponType.BLUNT1H) {
                maxDis = 73;
            }
            if(weapon == MapleWeaponType.STAFF || weapon == MapleWeaponType.WAND) {
                maxDis = 51;
            }
            if(weapon == MapleWeaponType.CLAW) {
                skil = SkillFactory.getSkill(4000001);
                skill = player.getSkillLevel(skil);
                if(skill > 0){
                maxDis = (skil.getEffect(player.getSkillLevel(skil)).getRange()) + 205;
                }
                else {
                    maxDis = 205;
                }
            }
            if(weapon == MapleWeaponType.BOW || weapon == MapleWeaponType.CROSSBOW) {
                skil = SkillFactory.getSkill(3000002);
                skill = player.getSkillLevel(skil);
                if(skill > 0){
                maxDis = (skil.getEffect(player.getSkillLevel(skil)).getRange()) + 270;
                }
                else {
                    maxDis = 270;
                }
            }
        }
        return maxDis;
        }

under
Code:
	public int getCurrentMaxBaseDamage() {
		return localmaxbasedamage;
	}

then add
Code:
        public int calculateMinBaseDamage (int watk, MapleCharacter player) {
                int minbasedamage = 0;
                if (watk == 0) {
                        minbasedamage = 1;
                } else {
                    IItem weapon_item = getInventory(MapleInventoryType.EQUIPPED).getItem((byte) - 11);
                    if( weapon_item != null) {
                        MapleWeaponType weapon = MapleItemInformationProvider.getInstance().getWeaponType(weapon_item.getItemId());
                        //mastery start
                        if (player.getJob().isA(MapleJob.FIGHTER)) {
                        skil = SkillFactory.getSkill(1100000);
                        skill = player.getSkillLevel(skil);
                        if(skill > 0){
                        sword = ((skil.getEffect(player.getSkillLevel(skil)).getMastery() * 5 + 10) / 100);
                        }
                        else {
                            sword = 0.1;
                        }
                        }
                        else {
                        skil = SkillFactory.getSkill(1200000);
                        skill = player.getSkillLevel(skil);
                        if(skill > 0){
                        sword = ((skil.getEffect(player.getSkillLevel(skil)).getMastery() * 5 + 10) / 100);
                        }
                        else {
                            sword = 0.1;
                        }
                        }
                        skil = SkillFactory.getSkill(1100001);
                        skill = player.getSkillLevel(skil);
                        if(skill > 0){
                        axe = ((skil.getEffect(player.getSkillLevel(skil)).getMastery() * 5 + 10) / 100);
                        }
                        else {
                            axe = 0.1;
                        }
                        skil = SkillFactory.getSkill(1200001);
                        skill = player.getSkillLevel(skil);
                        if(skill > 0){
                        blunt = ((skil.getEffect(player.getSkillLevel(skil)).getMastery() * 5 + 10) / 100);
                        }
                        else {
                            blunt = 0.1;
                        }
                        skil = SkillFactory.getSkill(1300000);
                        skill = player.getSkillLevel(skil);
                        if(skill > 0){
                        spear = ((skil.getEffect(player.getSkillLevel(skil)).getMastery() * 5 + 10) / 100);
                        }
                        else {
                            spear = 0.1;
                        }
                        skil = SkillFactory.getSkill(1300001);
                        skill = player.getSkillLevel(skil);
                        if(skill > 0){
                        polearm = ((skil.getEffect(player.getSkillLevel(skil)).getMastery() * 5 + 10) / 100);
                        }
                        else {
                            polearm = 0.1;
                        }
                        skil = SkillFactory.getSkill(3200000);
                        skill = player.getSkillLevel(skil);
                        if(skill > 0){
                        crossbow = ((skil.getEffect(player.getSkillLevel(skil)).getMastery() * 5 + 10) / 100);
                        }
                        else {
                            crossbow = 0.1;
                        }
                        skil = SkillFactory.getSkill(3100000);
                        skill = player.getSkillLevel(skil);
                        if(skill > 0){
                        bow = ((skil.getEffect(player.getSkillLevel(skil)).getMastery() * 5 + 10) / 100);
                        }
                        else {
                            bow = 0.1;
                        }
                        //end mastery
                        if (weapon == MapleWeaponType.CROSSBOW) {
                            minbasedamage = (int) (localdex * 0.9 * 3.6 * crossbow + localstr) / 100 * (watk + 15);
                        }
                        if (weapon == MapleWeaponType.BOW) {
                            minbasedamage = (int) (localdex * 0.9 * 3.4 * bow + localstr) / 100 * (watk + 15);
                        }
                        if (getJob().isA(MapleJob.THIEF) && (weapon == MapleWeaponType.DAGGER)) {
                            minbasedamage = (int) (localluk * 0.9 * 3.6 * dagger + localstr + localdex) / 100 * watk;
                        }
                        if (!getJob().isA(MapleJob.THIEF) && (weapon == MapleWeaponType.DAGGER)) {
                            minbasedamage = (int) (localstr * 0.9 * 4.0 * dagger + localdex) / 100 * watk;
                        }
                        if (getJob().isA(MapleJob.THIEF) && (weapon == MapleWeaponType.CLAW)) {
                            minbasedamage = (int) (localluk * 0.9 * 3.6 * claw + localstr + localdex) / 100 * (watk + 15);
                        }
                        if (weapon == MapleWeaponType.SPEAR) {
                            minbasedamage = (int) (localstr * 0.9 * 3.0 * spear + localdex) / 100 * watk;
                        }
                        if (weapon == MapleWeaponType.POLE_ARM) {
                            minbasedamage = (int) (localstr * 0.9 * 3.0 * polearm + localdex) / 100 * watk;
                        }
                        if (weapon == MapleWeaponType.SWORD1H) {
                            minbasedamage = (int) (localstr * 0.9 * 4.0 * sword + localdex) / 100 * watk;
                        }
                        if (weapon == MapleWeaponType.SWORD2H) {
                            minbasedamage = (int) (localstr * 0.9 * 4.6 * sword + localdex) / 100 * watk;
                        }
                        if (weapon == MapleWeaponType.AXE1H) {
                            minbasedamage = (int) (localstr * 0.9 * 3.2 * axe + localdex) / 100 * watk;
                        }
                        if (weapon == MapleWeaponType.BLUNT1H) {
                            minbasedamage = (int) (localstr * 0.9 * 3.2 * blunt + localdex) / 100 * watk;
                        }
                        if (weapon == MapleWeaponType.AXE2H) {
                            minbasedamage = (int) (localstr * 0.9 * 3.4 * axe + localdex) / 100 * watk;
                        }
                        if (weapon == MapleWeaponType.BLUNT2H) {
                            minbasedamage = (int) (localstr * 0.9 * 3.4 * blunt + localdex) / 100 * watk;
                        }
                        if (weapon == MapleWeaponType.STAFF || weapon == MapleWeaponType.WAND) {
                            minbasedamage = (int) (localstr * 0.9 * 3.0 * staffwand + localdex) / 100 * watk;
                        }
                    }
                }
                return minbasedamage;
        }

under the

public int calculateMaxBaseDamage (int watk)

function

THEN add this
Code:
        public MaplePacket makeHPBarPacket(MapleCharacter player) {
                byte tagcolor = 01;
                byte tagbgcolor = 05;
		return MaplePacketCreator.showBossHP(9400711, player.getHp(), player.getMaxHp(), tagcolor, tagbgcolor);
        }

above/before
Code:
public void handleOrbgain() {
	    int orbcount = getBuffedValue(MapleBuffStat.COMBO);
		ISkill combo = SkillFactory.getSkill(1111002);
		ISkill advcombo = SkillFactory.getSkill(1120003);

In MapleMap.java.. add at the bottom
Code:
        public Collection<MapleCharacter> getNearestPvpChar(Point attacker, double maxRange, double maxHeight, Collection<MapleCharacter> chr) {
                Collection<MapleCharacter> character = new LinkedList<MapleCharacter>();
                for (MapleCharacter a : characters) {
                        if (chr.contains(a.getClient().getPlayer())) {
                                Point attackedPlayer = a.getPosition();
                                MaplePortal Port = a.getMap().findClosestSpawnpoint(a.getPosition());
                                Point nearestPort = Port.getPosition();
                                double safeDis = attackedPlayer.distance(nearestPort);
                                double distanceX = attacker.distance(attackedPlayer.getX(), attackedPlayer.getY());
                                if(MaplePvp.isLeft) {
                                        if (attacker.x > attackedPlayer.x && distanceX < maxRange && distanceX > 2 && attackedPlayer.y >= attacker.y - maxHeight && attackedPlayer.y <= attacker.y + maxHeight) {
                                                character.add(a);
                                        }
                                }
                                if(MaplePvp.isRight) {
                                        if (attacker.x < attackedPlayer.x && distanceX < maxRange && distanceX > 2 && attackedPlayer.y >= attacker.y - maxHeight && attackedPlayer.y <= attacker.y + maxHeight) {
                                                character.add(a);
                                        }
                                }
                        }
                }
                return character;
        }
}

and finally.. in AbstractDealDamageHandler.java.. add
Code:
                //pvp monster bombs
                if (attack.skill != 2301002 && player.getMapId() == PVPMAPIDYOUWANT) {//heal
                MaplePvp.doPvP(player, map, attack);
                }
                //end pvp monster bombs

under
Code:
MapleMap map = player.getMap();

remember, this is a buggy/glitchy/messy code for now so u should definitely use it.

i will clean up the code tomorrow.
 
Master Summoner
Joined
May 31, 2008
Messages
524
Reaction score
1
Re: [Release]OdinMS Upgraded Beta PvP!

Uh... So what does this do to the PvP?
 
Experienced Elementalist
Joined
Apr 2, 2008
Messages
255
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

whats the diferent of that code and the first pvp?
 
Newbie Spellweaver
Joined
Jan 4, 2007
Messages
69
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

It looks like it's more realistic, custom distance attacks for every weapon based on real distances, more based on player stats.
 
Banned
Banned
Joined
Apr 10, 2008
Messages
1,295
Reaction score
113
Re: [Release]OdinMS Upgraded Beta PvP!

Read the code, seems like it goes by there stats and poop. o.o
 
Junior Spellweaver
Joined
Jul 19, 2008
Messages
151
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

that pvp looks awesome IF my assumption is correct by lookin at the script. It looks like the formula is more in depth and specific.
 
Junior Spellweaver
Joined
Jul 14, 2008
Messages
130
Reaction score
2
Re: [Release]OdinMS Upgraded Beta PvP!

alright nobody wants this thread, close it or delete it. im going to report it
 
Legendary Battlemage
Joined
May 23, 2008
Messages
628
Reaction score
4
Re: [Release]OdinMS Upgraded Beta PvP!

Lawl...
This is what i did for my PvP:
Instead of being based on stats and such...I made it based upon the skills you use
For instance:
My base atk for every skill is 100. All i do is apply the skill atk % and then i add :)
 
Junior Spellweaver
Joined
Jun 5, 2008
Messages
138
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

Anybody ested it? Is it good and better?
 
Junior Spellweaver
Joined
Jan 15, 2007
Messages
181
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

This seems better. It's more realistic o-o. The other script is like static atk damage.
 
Skilled Illusionist
Loyal Member
Joined
Jun 27, 2008
Messages
391
Reaction score
12
Re: [Release]OdinMS Upgraded Beta PvP!

You're "assumption" posts are useless. Just test it and then find out how it works. I cannot seeing how I am only one person and I don't want to make my stuff "public", etc.
 
Newbie Spellweaver
Joined
Dec 7, 2007
Messages
11
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

not yet... but thanks to oaix2 maybe we can finally get a more realistic pvp... like in the youtube videos...
 
Master Summoner
Loyal Member
Joined
Nov 30, 2007
Messages
511
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

alright nobody wants this thread, close it or delete it. im going to report it
...What's with you? People are going to want to know what they're adding in before they do it, and you neglected to explain what you're giving people here. Personally, I don't care (I'll be using it no matter what it is), but I can see why other people aren't being as open to using your script than you want.
 
Junior Spellweaver
Joined
Jul 12, 2008
Messages
105
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

so whats this do...?
and have you even tested this o_O""
 
Junior Spellweaver
Joined
Jul 14, 2008
Messages
130
Reaction score
2
Re: [Release]OdinMS Upgraded Beta PvP!

im tired... ill explain tomorrow.. but people really should read teh code. they'd find out that combo works, theres a bad hp bar, mp eater, and mesoguard/magicguard
 
Newbie Spellweaver
Joined
Jul 13, 2008
Messages
81
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

this one is nice =]

very easy to add to your server.

airflow0's , doesnt work very well
 
Junior Spellweaver
Joined
Jul 19, 2008
Messages
151
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

...What's with you? People are going to want to know what they're adding in before they do it, and you neglected to explain what you're giving people here. Personally, I don't care (I'll be using it no matter what it is), but I can see why other people aren't being as open to using your script than you want.

maybe it's his way of preventing people who can't even read the code from compiling and saying" ZOMG H3LP M3 PL0X 1 H4V3 SYMB0L ERR0Rzzzzz!!!!1!!1one!11one!"
 
Experienced Elementalist
Joined
Sep 7, 2006
Messages
245
Reaction score
0
Re: [Release]OdinMS Upgraded Beta PvP!

I'm pretty sure that it'll clear the points if you recompile? I could be wrong.
 
Status
Not open for further replies.
Back
Top