VB/VB.Net Petite demande calcule XP

Inscrit
5 Juin 2011
Messages
16
Reactions
0
#1
Bonjour,


Je cherche la formule pour savoir combien ont va xp sur un groupe de monstre mais je nais pas trouver cela dans les sources de d$fus quelqu’un sais ou je peux trouver sa sil vous plait
 
A

Anonymous

Invité
#2
Le calcul c'est un truc de ce genre, je sais plus qui m'en avait parlé, c'est l'addition de tout les niveau de monstres multiplie par quelque chose. Fait une division pour trouve par quel nombre on multipli.
 
A

Anonymous

Invité
#3
Si la formule est dans le client, l'XP d'un groupe est ecrit lorsque tu passe la souris dessus. :)
 
A

Anonymous

Invité
#4
\ui\A*****_Tooltips\Tooltips.swf\ui\WorldRpMonstersGroupTooltipUi

Code:
package ui
{
    import d2api.*;
    import d2data.*;
    import d2network.*;

    public class WorldRpMonstersGroupTooltipUi extends Object
    {
        public var tooltipApi:TooltipApi;
        public var uiApi:UiApi;
        public var utilApi:UtilApi;
        public var dataApi:DataApi;
        public var partyApi:PartyApi;
        public var playerApi:PlayedCharacterApi;
        public var sysApi:SystemApi;
        public var socialApi:SocialApi;
        public var mainCtr:Object;
        public var tx_background:Object;
        public var starsCtr:Object;
        public var lbl_level:Object;
        public var lbl_monsterList:Object;
        public var levelCtr:Object;
        public var tx_back:Object;
        public var lbl_monsterXp:Object;
        public var monsterXpContainer:Object;
        public var star00:Object;
        public var star01:Object;
        public var star02:Object;
        public var star03:Object;
        public var star04:Object;
        public var star10:Object;
        public var star11:Object;
        public var star12:Object;
        public var star13:Object;
        public var star14:Object;
        public var star20:Object;
        public var star21:Object;
        public var star22:Object;
        public var star23:Object;
        public var star24:Object;

        public function WorldRpMonstersGroupTooltipUi()
        {
            return;
        }// end function

        public function main(param1:Object = null) : void
        {
            var _loc_7:* = undefined;
            var _loc_8:Monster = null;
            var _loc_9:int = 0;
            var _loc_10:Array = null;
            var _loc_11:uint = 0;
            var _loc_13:Object = null;
            var _loc_15:int = 0;
            var _loc_16:int = 0;
            var _loc_17:int = 0;
            var _loc_18:int = 0;
            var _loc_2:* = param1.data;
            var _loc_3:* = _loc_2.ageBonus != -1;
            this.tx_back.width = 1;
            this.tx_back.height = 1;
            this.star00.visible = false;
            this.star01.visible = false;
            this.star02.visible = false;
            this.star03.visible = false;
            this.star04.visible = false;
            this.star10.visible = false;
            this.star11.visible = false;
            this.star12.visible = false;
            this.star13.visible = false;
            this.star14.visible = false;
            this.star20.visible = false;
            this.star21.visible = false;
            this.star22.visible = false;
            this.star23.visible = false;
            this.star24.visible = false;
            var _loc_4:* = new Array();
            var _loc_5:* = new Array();
            var _loc_6:* = this.dataApi.getMonsterFromId(_loc_2.mainCreatureGenericId).grades[(_loc_2.mainCreatureGrade - 1)].level;
            _loc_4[_loc_2.mainCreatureGenericId] = _loc_6;
            _loc_5[_loc_2.mainCreatureGenericId] = _loc_6;
            for each (_loc_7 in _loc_2.underlings)
            {
                
                _loc_8 = this.dataApi.getMonsterFromId(_loc_7.creatureGenericId);
                _loc_9 = _loc_8.grades[(_loc_7.grade - 1)].level;
                if (_loc_4[_loc_7.creatureGenericId] && _loc_4[_loc_7.creatureGenericId] > 0)
                {
                    _loc_4[_loc_7.creatureGenericId] = _loc_4[_loc_7.creatureGenericId] + _loc_9;
                }
                else
                {
                    _loc_4[_loc_7.creatureGenericId] = _loc_9;
                }
                if (_loc_5[_loc_7.creatureGenericId] && _loc_5[_loc_7.creatureGenericId] > 0)
                {
                    if (_loc_5[_loc_7.creatureGenericId] < _loc_9)
                    {
                        _loc_5[_loc_7.creatureGenericId] = _loc_9;
                    }
                    continue;
                }
                _loc_5[_loc_7.creatureGenericId] = _loc_9;
            }
            _loc_10 = [];
            _loc_10.push({monsterId:_loc_2.mainCreatureGenericId, level:this.dataApi.getMonsterFromId(_loc_2.mainCreatureGenericId).grades[(_loc_2.mainCreatureGrade - 1)].level, grade:_loc_2.mainCreatureGrade, totalLevel:_loc_4[_loc_2.mainCreatureGenericId], maxLevel:_loc_5[_loc_2.mainCreatureGenericId]});
            _loc_11 = this.dataApi.getMonsterFromId(_loc_2.mainCreatureGenericId).grades[(_loc_2.mainCreatureGrade - 1)].level;
            for each (_loc_7 in _loc_2.underlings)
            {
                
                _loc_9 = this.dataApi.getMonsterFromId(_loc_7.creatureGenericId).grades[(_loc_7.grade - 1)].level;
                _loc_11 = _loc_11 + _loc_9;
                _loc_10.push({monsterId:_loc_7.creatureGenericId, level:_loc_9, grade:_loc_7.grade, totalLevel:_loc_4[_loc_7.creatureGenericId], maxLevel:_loc_5[_loc_7.creatureGenericId]});
            }
            _loc_10.sort(this.xtremAdvancedSortMonster);
            if (_loc_2.alignmentSide == 1)
            {
                this.lbl_monsterList.cssClass = "bonta";
            }
            else if (_loc_2.alignmentSide == 2)
            {
                this.lbl_monsterList.cssClass = "brakmar";
            }
            else
            {
                this.lbl_monsterList.cssClass = "center";
            }
            this.starsCtr.removeFromParent();
            this.lbl_monsterList.removeFromParent();
            this.lbl_monsterXp.removeFromParent();
            this.monsterXpContainer.removeFromParent();
            if (_loc_3)
            {
                _loc_15 = _loc_2.ageBonus;
                if (_loc_15 == -1)
                {
                    _loc_15 = 0;
                }
                if (_loc_15 > 100)
                {
                    _loc_16 = 2;
                    _loc_15 = _loc_15 - 100;
                }
                else
                {
                    _loc_16 = 1;
                }
                _loc_17 = int(_loc_15 / 20);
                _loc_18 = 0;
                while (_loc_18 < _loc_17)
                {
                    
                    this["star" + _loc_16 + "" + _loc_18].visible = true;
                    _loc_18++;
                }
                _loc_18 = _loc_18;
                while (_loc_18 < 5)
                {
                    
                    this["star" + (_loc_16 - 1) + "" + _loc_18].visible = true;
                    _loc_18++;
                }
                this.lbl_monsterXp.y = 40;
                this.monsterXpContainer.y = 70;
            }
            else
            {
                this.lbl_monsterXp.y = 20;
                this.monsterXpContainer.y = 50;
            }
            this.lbl_level.text = this.uiApi.getText("ui.common.level") + " " + _loc_11;
            var _loc_12:String = "";
            for each (_loc_13 in _loc_10)
            {
                
                _loc_8 = this.dataApi.getMonsterFromId(_loc_13.monsterId);
                _loc_12 = _loc_12 + ("\n" + (_loc_8.isMiniBoss ? ("<b>") : ("")) + _loc_8.name + " (" + _loc_8.grades[(_loc_13.grade - 1)].level + ")" + (_loc_8.isMiniBoss ? ("</b>") : ("")));
            }
            if (_loc_12)
            {
                _loc_12 = _loc_12.substr(1);
            }
            if (this.lbl_monsterList.width < 130)
            {
                this.lbl_monsterList.width = 130;
            }
            this.levelCtr.removeFromParent();
            if (_loc_3)
            {
                this.starsCtr.y = 25;
                this.lbl_monsterXp.y = 42;
            }
            var _loc_14:* = this.calculateXpMonsters(_loc_10, _loc_2.ageBonus);
            this.lbl_monsterXp.text = this.uiApi.getText("ui.tooltip.monsterXpAlone", this.utilApi.formateIntToString(_loc_14[0]));
            if (this.partyApi.getPartyMembers().length > 0)
            {
                this.lbl_monsterList.y = this.lbl_monsterXp.y + 52;
                this.monsterXpContainer.y = this.monsterXpContainer.y + 22;
                this.lbl_monsterXp.text = this.lbl_monsterXp.text + ("\n" + this.uiApi.getText("ui.tooltip.monsterXpParty", this.utilApi.formateIntToString(_loc_14[1])));
            }
            else
            {
                this.lbl_monsterList.y = this.lbl_monsterXp.y + 32;
            }
            this.lbl_monsterList.text = _loc_12;
            this.lbl_monsterList.fullWidth();
            this.lbl_monsterXp.fullWidth();
            if (this.starsCtr.width > this.lbl_monsterList.width && this.starsCtr.width > this.lbl_monsterXp.width)
            {
                var _loc_19:* = this.starsCtr.width;
                this.monsterXpContainer.width = this.starsCtr.width;
                var _loc_19:* = _loc_19;
                this.lbl_monsterXp.width = _loc_19;
                this.lbl_monsterList.width = _loc_19;
            }
            else if (this.lbl_monsterList.width >= this.lbl_monsterXp.width)
            {
                var _loc_19:* = this.lbl_monsterList.width;
                this.monsterXpContainer.width = this.lbl_monsterList.width;
                this.lbl_monsterXp.width = _loc_19;
            }
            else
            {
                var _loc_19:* = this.lbl_monsterXp.width;
                this.monsterXpContainer.width = this.lbl_monsterXp.width;
                this.lbl_monsterList.width = _loc_19;
            }
            this.monsterXpContainer.x = ((this.lbl_monsterList.width > this.lbl_monsterXp.width ? (this.lbl_monsterList.width) : (this.lbl_monsterXp.width)) - this.monsterXpContainer.width) / 2;
            this.mainCtr.addContent(this.lbl_monsterList);
            this.mainCtr.addContent(this.lbl_monsterXp);
            this.mainCtr.addContent(this.monsterXpContainer);
            this.tx_back.width = this.mainCtr.width + 8;
            this.tx_back.height = this.mainCtr.height + 8;
            this.mainCtr.addContent(this.tx_back, 0);
            this.levelCtr.x = (this.tx_back.width - this.levelCtr.width) / 2 - 2;
            this.mainCtr.addContent(this.levelCtr);
            if (_loc_3)
            {
                this.starsCtr.x = (this.tx_back.width - this.starsCtr.width) / 2 - 1;
                this.mainCtr.addContent(this.starsCtr);
            }
            this.tooltipApi.place(param1.position, param1.point, param1.relativePoint, param1.offset);
            return;
        }// end function

        private function xtremAdvancedSortMonster(param1:Object, param2:Object) : Number
        {
            var _loc_3:int = 0;
            if (param1.monsterId == param2.monsterId)
            {
                if (param1.level > param2.level)
                {
                    _loc_3 = -1;
                }
                else if (param1.level < param2.level)
                {
                    _loc_3 = 1;
                }
                else
                {
                    _loc_3 = 0;
                }
            }
            else if (param1.maxLevel > param2.maxLevel)
            {
                _loc_3 = -1;
            }
            else if (param1.maxLevel < param2.maxLevel)
            {
                _loc_3 = 1;
            }
            else if (param1.totalLevel > param2.totalLevel)
            {
                _loc_3 = -1;
            }
            else if (param1.totalLevel < param2.totalLevel)
            {
                _loc_3 = 1;
            }
            else
            {
                _loc_3 = 0;
            }
            return _loc_3;
        }// end function

        private function calculateXpMonsters(param1:Array, param2:int) : Array
        {
            var _loc_3:Object = null;
            var _loc_9:MonsterGrade = null;
            var _loc_10:uint = 0;
            var _loc_11:uint = 0;
            var _loc_12:Number = NaN;
            var _loc_34:Number = NaN;
            var _loc_4:uint = 0;
            var _loc_5:uint = 0;
            var _loc_6:uint = 0;
            var _loc_7:* = this.playerApi.getPlayedCharacterInfo();
            var _loc_8:* = this.playerApi.characteristics();
            for each (_loc_3 in param1)
            {
                
                _loc_9 = this.dataApi.getMonsterFromId(_loc_3.monsterId).grades[(_loc_3.grade - 1)];
                _loc_4 = _loc_4 + _loc_9.gradeXp;
                _loc_6 = _loc_6 + _loc_9.level;
                if (_loc_9.level > _loc_5)
                {
                    _loc_5 = _loc_9.level;
                }
            }
            _loc_10 = _loc_7.level;
            _loc_11 = _loc_7.level;
            for each (_loc_3 in this.partyApi.getPartyMembers())
            {
                
                if (_loc_3.id != _loc_7.id)
                {
                    _loc_10 = _loc_10 + _loc_3.level;
                    if (_loc_3.level > _loc_11)
                    {
                        _loc_11 = _loc_3.level;
                    }
                }
            }
            _loc_12 = 1;
            if (_loc_10 - 5 > _loc_6)
            {
                _loc_12 = _loc_6 / _loc_10;
            }
            else if (_loc_10 + 10 < _loc_6)
            {
                _loc_12 = (_loc_10 + 10) / _loc_6;
            }
            var _loc_13:Number = 1;
            if (_loc_7.level - 5 > _loc_6)
            {
                _loc_13 = _loc_6 / _loc_7.level;
            }
            else if (_loc_7.level + 10 < _loc_6)
            {
                _loc_13 = (_loc_7.level + 10) / _loc_6;
            }
            var _loc_14:* = Math.min(_loc_7.level, this.truncate(2.5 * _loc_5));
            var _loc_15:* = Math.min(_loc_7.level, this.truncate(2.5 * _loc_5)) / _loc_7.level * 100;
            var _loc_16:* = _loc_14 / _loc_10 * 100;
            var _loc_17:Array = [1, 1.1, 1.5, 2.3, 3.1, 3.6, 4.2, 4.7];
            var _loc_18:* = this.truncate(_loc_4 * _loc_17[0] * _loc_13);
            var _loc_19:uint = 0;
            for each (_loc_3 in this.partyApi.getPartyMembers())
            {
                
                if (_loc_3.level >= _loc_11 / 3)
                {
                    _loc_19 = _loc_19 + 1;
                }
            }
            if (_loc_19 == 0)
            {
                _loc_19 = 1;
            }
            var _loc_20:* = this.truncate(_loc_4 * _loc_17[(_loc_19 - 1)] * _loc_12);
            var _loc_21:* = this.truncate(_loc_15 / 100 * _loc_18);
            var _loc_22:* = this.truncate(_loc_16 / 100 * _loc_20);
            var _loc_23:* = _loc_8.wisdom.base + _loc_8.wisdom.objectsAndMountBonus + _loc_8.wisdom.alignGiftBonus + _loc_8.wisdom.contextModif;
            if (_loc_8.wisdom.base + _loc_8.wisdom.objectsAndMountBonus + _loc_8.wisdom.alignGiftBonus + _loc_8.wisdom.contextModif < 0)
            {
                _loc_23 = 0;
            }
            var _loc_24:* = param2 <= 0 ? (1) : (1 + param2 / 100);
            var _loc_25:* = this.truncate(this.truncate(_loc_21 * (100 + _loc_23) / 100) * _loc_24);
            var _loc_26:* = this.truncate(this.truncate(_loc_22 * (100 + _loc_23) / 100) * _loc_24);
            var _loc_27:* = this.sysApi.getPlayerManager().server;
            if (this.sysApi.getPlayerManager().server.gameTypeId != 0)
            {
                _loc_34 = 1 + this.playerApi.getExperienceBonusPercent() / 100;
                _loc_25 = this.truncate(_loc_25 * _loc_34);
                _loc_26 = this.truncate(_loc_26 * _loc_34);
            }
            var _loc_28:uint = 0;
            var _loc_29:uint = 0;
            var _loc_30:* = this.playerApi.getMount();
            if (this.playerApi.getMount() != null && this.playerApi.isRidding() == true)
            {
                _loc_28 = this.truncate(_loc_25 * _loc_30.xpRatio / 100);
                _loc_29 = this.truncate(_loc_26 * _loc_30.xpRatio / 100);
            }
            _loc_25 = _loc_25 - _loc_28;
            _loc_26 = _loc_26 - _loc_29;
            var _loc_31:uint = 0;
            var _loc_32:uint = 0;
            var _loc_33:* = this.getPlayerGuild(_loc_7.id);
            if (this.getPlayerGuild(_loc_7.id) != null && _loc_33.experienceGivenPercent > 0)
            {
                _loc_31 = this.truncate(_loc_25 * _loc_33.experienceGivenPercent / 100);
                _loc_32 = this.truncate(_loc_26 * _loc_33.experienceGivenPercent / 100);
            }
            _loc_25 = _loc_25 - _loc_31;
            _loc_26 = _loc_26 - _loc_32;
            return [_loc_25, _loc_26];
        }// end function

        private function truncate(param1:Number) : int
        {
            var _loc_2:* = Math.pow(10, 0);
            var _loc_3:* = param1 * _loc_2;
            return int(_loc_3) / _loc_2;
        }// end function

        private function getPlayerGuild(param1:int) : GuildMember
        {
            var _loc_2:GuildMember = null;
            for each (_loc_2 in this.socialApi.getGuildMembers())
            {
                
                if (_loc_2.id == param1)
                {
                    return _loc_2;
                }
            }
            return null;
        }// end function

        public function unload() : void
        {
            return;
        }// end function

    }
}
 
Inscrit
5 Juin 2011
Messages
16
Reactions
0
#5
Merci bien mais si je me troupe pas il y a pas une xp de base pour chacun des monstre et si oui ou je peux trouver sa ? merci
 
A

Anonymous

Invité
#6
Relis la formule, c'est indiqué dedans.
 
Inscrit
5 Juin 2011
Messages
16
Reactions
0
#7
ok ^^' j'ai trouvé un truc comme cela sauf que j'ai un probleme si le joueurs est niveau 1 et le monstre 3 par exemple ben sa marche pas :s et j'ai pas trouver comment faire

Dim Base As Double = 50
Dim NMTotal As Double = 1
Dim Njoueur As Double = 1
Dim NEquipe As Double = 1
Dim Coef As Double = 0
Dim Sasa As Double = 0
Dim Modif1 As Double
Dim Modif2 As Double
Dim Modif3 As Double
Modif1 = Njoueur / NEquipe

If NMTotal > NEquipe + 10 Then
Modif2 = (NEquipe + 10) / NMTotal

End If

If NEquipe > NMTotal + 5 Then
Modif2 = NMTotal / NEquipe

End If
If NEquipe > NMTotal * 2.5 Then
Modif2 = ((Math.Floor(NMTotal * 2.5) / NEquipe))

End If
Dim test As Double = 4

Modif3 = 1

dim resulta = Base * ((Sasa + 100) / 100) * ((Coef + 100) / 100) * Modif2
 
Haut Bas