Full Mob Skill And Mob Attack GMS v75 - GMS ALike

Results 1 to 13 of 13
  1. #1
    Account Upgraded | Title Enabled! ExtremeDevilz is offline
    MemberRank
    Apr 2008 Join Date
    647Posts

    Full Mob Skill And Mob Attack MoopleDev Rev 120 GMS ALike

    MoveLifeHandler

    Code:
    /*
        This file is part of the OdinMS Maple Story Server
        Copyright (C) 2008 Patrick Huy <patrick.huy@frz.cc>
                   Matthias Butz <matze@odinms.de>
                   Jan Christian Meyer <vimes@odinms.de>
    
    
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU Affero General Public License as
        published by the Free Software Foundation version 3 as published by
        the Free Software Foundation. You may not use, modify or distribute
        this program under any other version of the GNU Affero General Public
        License.
    
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU Affero General Public License for more details.
    
    
        You should have received a copy of the GNU Affero General Public License
        along with this program.  If not, see <http://www.gnu.org/licenses/>.
    */
    package net.server.channel.handlers;
    
    
    import client.MapleClient;
    
    
    import java.awt.Point;
    import java.util.List;
    
    
    import server.life.MapleMonster;
    import server.life.MobAttackInfo;
    import server.life.MobAttackInfoFactory;
    import server.life.MobSkill;
    import server.life.MobSkillFactory;
    import server.maps.MapleMapObject;
    import server.maps.MapleMapObjectType;
    import server.movement.LifeMovementFragment;
    import tools.CollectionUtil;
    import tools.MaplePacketCreator;
    import tools.Pair;
    import tools.Randomizer;
    import tools.data.input.SeekableLittleEndianAccessor;
    
    
    /**
    *
    *  @author Danny (Leifde)
    *  @author ExtremDevilz 
    */
    public final class MoveLifeHandler extends AbstractMovementPacketHandler {
        @Override
        public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
            int objectid = slea.readInt();
            short moveid = slea.readShort();
            MapleMapObject mmo = c.getPlayer().getMap().getMapObject(objectid);
            if (mmo == null || mmo.getType() != MapleMapObjectType.MONSTER) {
                return;
            }
            MapleMonster monster = (MapleMonster) mmo;
            List<LifeMovementFragment> res = null;
            byte pNibbles = slea.readByte();
            byte rawActivity = slea.readByte();
            byte useSkillId = slea.readByte();
            byte useSkillLevel = slea.readByte();
            short pOption = slea.readShort();
    
    
    
    
            byte parsedActivity = rawActivity;
    
    
    
    
            if (parsedActivity >= 0) {
                parsedActivity = (byte) (parsedActivity & 0xFF >> 1);
            }
    
    
    
    
            boolean isAttack = CollectionUtil.inRangeInclusive(parsedActivity, 12, 20);
            boolean isSkill = CollectionUtil.inRangeInclusive(parsedActivity, 21, 25);
    
    
    
    
            byte attackId = (byte) (isAttack ? parsedActivity - 12 : -1);
            boolean nextMovementCouldBeSkill = (pNibbles & 0x0F) != 0;
            boolean pUnk = (pNibbles & 0xF0) != 0;
            
            int nextCastSkill = useSkillId;
            int nextCastSkillLevel = useSkillLevel;
            
            MobAttackInfo mobAttack = null;
            MobSkill toUse = null;
            
                
            if (isAttack) {                
                    mobAttack = MobAttackInfoFactory.getMobAttackInfo(monster, attackId);
                    System.out.println("Attacked");
            }
            
            if (isSkill) {
                if (monster.getNoSkills() > 0) {
                    int Random = Randomizer.nextInt(monster.getNoSkills()); // Random Monster Skill
                    Pair<Integer, Integer> skillToUse = monster.getSkills().get(Random);
                    nextCastSkill = skillToUse.getLeft();
                    nextCastSkillLevel = skillToUse.getRight();
                    toUse = MobSkillFactory.getMobSkill(nextCastSkill, nextCastSkillLevel);
                    int percHpLeft = (int) ((monster.getHp() / monster.getMaxHp()) * 100);   
                    
                    if (nextCastSkill != toUse.getSkillId() || nextCastSkillLevel != toUse.getSkillLevel()) { // Match The Client Response Packet ?
                        toUse.resetAnticipatedSkill();
                        System.out.println("Nope");
                        return;
                    }
                    
                    if (monster.hasSkill(nextCastSkill, nextCastSkillLevel) && monster.canUseSkill(toUse) && toUse != null) {          
                        if (toUse.getHP() < percHpLeft || !monster.canUseSkill(toUse)) {
                            toUse = null;
                            System.out.println("toUse == Null");
                        } else {
                            toUse.applyEffect(c.getPlayer(), monster, true);
                            System.out.println("Appiled: " + nextCastSkill + "Level: " + nextCastSkillLevel);
                            }
                        }            
                    }
                }
            slea.readByte();
            slea.readInt(); // whatever
            short start_x = slea.readShort(); // hmm.. startpos?
            short start_y = slea.readShort(); // hmm...
            Point startPos = new Point(start_x, start_y);
            res = parseMovement(slea);
            if (monster.getController() != c.getPlayer()) {
                if (monster.isAttackedBy(c.getPlayer())) {// aggro and controller change
                    monster.switchController(c.getPlayer(), true);
                } else {
                    return;
                }
            } else if (parsedActivity == -1 && monster.isControllerKnowsAboutAggro() && !monster.isMobile() && !monster.isFirstAttack()) {
                monster.setControllerHasAggro(false);
                monster.setControllerKnowsAboutAggro(false);
            }
            boolean aggro = monster.isControllerHasAggro();
            if (toUse != null) {
                c.announce(MaplePacketCreator.moveMonsterResponse(objectid, moveid, monster.getMp(), aggro, toUse.getSkillId(), toUse.getSkillLevel()));
            } else {
                c.announce(MaplePacketCreator.moveMonsterResponse(objectid, moveid, monster.getMp(), aggro));
            }
            if (aggro) {
                monster.setControllerKnowsAboutAggro(true);
            }
            if (res != null) {
                c.getPlayer().getMap().broadcastMessage(c.getPlayer(), MaplePacketCreator.moveMonster(objectid, nextMovementCouldBeSkill, rawActivity, useSkillId, useSkillLevel, pOption , startPos, res), monster.getPosition());
                updatePosition(res, monster, -1);
                c.getPlayer().getMap().moveMonster(monster, monster.getPosition());
            }
        }
    }
    CollectionUtil

    Code:
    public static boolean inRangeInclusive(Byte pVal, Integer pMin, Integer pMax) {
            return !(pVal < pMin) || (pVal > pMax);
       }
    MaplePacketCreator

    Code:
     public static byte[] moveMonster(int oid, boolean skillPossible, byte rawAction, byte skill, byte level, short option, Point startPos, List<LifeMovementFragment> moves) {
            final MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
            mplew.writeShort(SendOpcode.MOVE_MONSTER.getValue());
            mplew.writeInt(oid);
            mplew.writeBool(skillPossible);
            mplew.write(rawAction);
            mplew.write(skill);
            mplew.write(level);
            mplew.writeShort(option);
            mplew.writePos(startPos);
            serializeMovementList(mplew, moves);
            return mplew.getPacket();
        }
    before you go around writing rubbish let me explain my old release had some glitches while It took me awhile to get this working It is still but it was way better then how it was written as the old version was totally wrong and inaccuracy, I don't know how prefect is this but it was based on Vana which the developer said it is quite accuracy, now if you wish to improve this you can go ahead and respect the decision that I have actually release this as it took me countless of effort to get this working.
    Last edited by ExtremeDevilz; 17-07-14 at 02:45 PM. Reason: Updated


  2. #2
    Account Upgraded | Title Enabled! Halcyon is offline
    MemberRank
    Mar 2011 Join Date
    1,102Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    ..Can you a least explain what's wrong with the old versions?

  3. #3
    Account Upgraded | Title Enabled! ExtremeDevilz is offline
    MemberRank
    Apr 2008 Join Date
    647Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by Lowsir View Post
    ..Can you a least explain what's wrong with the old versions?
    It was written wrongly and never was accurary to start of with.

  4. #4
    Member HawtMaple is offline
    MemberRank
    Sep 2013 Join Date
    88Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by Multo View Post
    pretty here is an updated and working version of MobSkill and yes those which are written in Lithium and early OdinTeh is wrong

    Code:
    int objectid = slea.readInt();
            short moveid = slea.readShort();
            MapleMapObject mmo = c.getPlayer().getMap().getMapObject(objectid);
            if (mmo == null || mmo.getType() != MapleMapObjectType.MONSTER) {
                return;
            }
            MapleMonster monster = (MapleMonster) mmo;
            List<LifeMovementFragment> res = null;
            byte pNibbles = slea.readByte();
            byte rawActivity = slea.readByte();
            byte useSkillId = slea.readByte();
            byte useSkillLevel = slea.readByte();
            short pOption = slea.readShort();
    
    
            byte parsedActivity = rawActivity;
    
    
            if (parsedActivity >= 0) {
                parsedActivity = (byte) (parsedActivity & 0xFF >> 1);
            }
    
    
            boolean isAttack = CollectionUtil.inRangeInclusive(parsedActivity, 12, 20);
            boolean isSkill = CollectionUtil.inRangeInclusive(parsedActivity, 21, 25);
    
    
            byte attackId = (byte) (isAttack ? parsedActivity - 12 : -1);
            boolean nextMovementCouldBeSkill = (pNibbles & 0x0F) != 0;
            boolean pUnk = (pNibbles & 0xF0) != 0;
            
            int nextCastSkill = 0;
            int nextCastSkillLevel = 0;
            
            MobSkill toUse = null;
            RandomDataGenerator pRandom = new RandomDataGenerator();
            
                
            if (isAttack) {                
                    MobAttackInfo mobAttack = MobAttackInfoFactory.getMobAttackInfo(monster, attackId);
                    System.out.println("Attacked");
            }
                
            if (isSkill) {
                if (monster.getNoSkills() > 0) {
                    int Random = pRandom.getRandomGenerator().nextInt(monster.getNoSkills());
                    Pair<Integer, Integer> skillToUse = monster.getSkills().get(Random);
                    nextCastSkill = skillToUse.getLeft();
                    nextCastSkillLevel = skillToUse.getRight();
                    toUse = MobSkillFactory.getMobSkill(nextCastSkill, nextCastSkillLevel);
                                   
                    if (nextCastSkill != toUse.getSkillId() || nextCastSkillLevel != toUse.getSkillLevel()) { // Match The Client Response Packet ?
                        toUse.resetAnticipatedSkill();
                        return;
                    }
                    
                    if (monster.hasSkill(nextCastSkill, nextCastSkillLevel) && monster.canUseSkill(toUse) && toUse != null) {
                        toUse.applyEffect(c.getPlayer(), monster, true);
                        System.out.println("Appiled: " + nextCastSkill + "Level: " + nextCastSkillLevel);
                    }
                                
                    int percHpLeft = (int) ((monster.getHp() / monster.getMaxHp()) * 100);             
                    if (toUse.getHP() < percHpLeft || !monster.canUseSkill(toUse)) {
                        toUse = null;
                        }
                    }
                }
    What is the point of adding another member variable when the first one has no use beside giving that one a value?

    Monster skills in MS aren't random and follow a pattern, why did you make them random?

    If this is a release why are there debug printouts?


    pro

  5. #5
    Account Upgraded | Title Enabled! ExtremeDevilz is offline
    MemberRank
    Apr 2008 Join Date
    647Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by HawtMaple View Post
    What is the point of adding another member variable when the first one has no use beside giving that one a value?

    Monster skills in MS aren't random and follow a pattern, why did you make them random?

    If this is a release why are there debug printouts?


    pro
    the debug print out was to check if everything was working correctly, the skills are randomly chosen and then sent to the client in the response packet and then animation is displayed and the client send it back

    I know I can improve the code abit more but I don't have time to work on it and possible I will in the future but for now it is 80% like gms

    just need to fix up the applyEffect which has been horribly written..

    most of the public server has been pretty much using it wrongly, and maybe if you were not so cocky in ignoring me maybe I could have tell you the exploits I have found in your server ;)

    cheers

  6. #6
    while(true) spam(); kevintjuh93 is offline
    MemberRank
    Jun 2008 Join Date
    The NetherlandsLocation
    4,119Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by HawtMaple View Post
    What is the point of adding another member variable when the first one has no use beside giving that one a value?

    Monster skills in MS aren't random and follow a pattern, why did you make them random?

    If this is a release why are there debug printouts?


    pro
    How is this not random?
    PHP Code:
    void __thiscall CMob::PrepareNextSkill(CMob *thisint *nSkillCommandint *nSLVint tCur)
    {
      
    int v4// edi@1
      
    CMob *v5// esi@1
      
    MobSkillInfo *v6// eax@2
      
    int v7// eax@3
      
    int v8// ecx@6
      
    int v9// edx@8
      
    MobSkillContext *v10// ebx@11
      
    MobSkillInfo *v11// ecx@12
      
    MOBSKILLLEVELDATA *v12// ecx@15
      
    int v13// eax@18
      
    signed int v14// eax@20
      
    bool v15// zf@24
      
    int v16// eax@24
      
    int v17// edi@25
      
    int v18// eax@28
      
    int v19// eax@29
      
    int v20// eax@38
      
    unsigned int *v21// eax@40
      
    int v22// ebx@46
      
    int *v23// eax@47
      
    unsigned int v24// edi@50
      
    unsigned int v25// eax@51
      
    int v26// eax@51
      
    int v27// ecx@51
      
    int nCount// [sp+8h] [bp-20h]@3
      
    ZArray<longanPossible// [sp+10h] [bp-18h]@8
      
    unsigned int v30// [sp+14h] [bp-14h]@9
      
    int i// [sp+18h] [bp-10h]@8
      
    int v32// [sp+24h] [bp-4h]@8

      
    v4 0;
      
    v5 this;
      *
    nSkillCommand 0;
      if ( 
    this->m_stat.nSealSkill_
        
    || (v6 this->m_pTemplate->aSkillInfo.a) == 0
        
    || (v7 = *((_DWORD *)v6 1), (nCount v7) == 0)
        || !
    this->m_bNextAttackPossible
        
    || this->m_nSkillCommand
        
    || (v8 this->m_tLastSkillUse) != && tCur v8 3000 )
        return;
      
    anPossible.0;
      
    v9 0;
      
    v32 0;
      
    0;
      if ( 
    v7 <= )
        goto 
    LABEL_52;
      
    v30 0;
      while ( 
    )
      {
        
    v10 = &v5->m_aSkillContext.a[v30 0x10];
        if ( (
    signed int)v30 >= v4 )
        {
          
    v11 v5->m_pTemplate->aSkillInfo.a;
          if ( 
    v11 != (MobSkillInfo *)v4 )
          {
            if ( (
    unsigned int)v9 < *((_DWORD *)v11 1) )
              
    v4 = (int)&v11[v9];
          }
        }
        
    v12 = &CSkillInfo::GetMobSkill(TSingleton<CSkillInfo>::ms_pInstance, *(_DWORD *)v4)->aLevelData.a[*(_DWORD *)(v4 4) - 1];
        if ( !
    v4
          
    || v12->nHPBelow && (double)v5->m_nHP / (double)v5->m_pTemplate->nMaxHP 100.0 > (double)v12->nHPBelow
          
    || (v13 v12->tInterval) != && v13 v10->tLastSkillUse tCur )
          goto 
    LABEL_48;
        
    v14 v10->nSkillID;
        if ( 
    v10->nSkillID 141 )
        {
          
    v20 v14 142;
          if ( !
    v20 )
          {
            
    v17 v5->m_stat.nHardSkin_;
            goto 
    LABEL_45;
          }
          if ( 
    v20 != 58 )
            goto 
    LABEL_47;
          
    v21 v12->adwTemplateID.a;
          if ( 
    v21 )
            
    v21 = (unsigned int *)*(v21 1);
          if ( (
    unsigned int)((char *)v21 v10->nSummoned) <= v12->nLimit )
          {
    LABEL_47:
            
    v23 ZArray<long>::InsertBefore(&anPossible, -1);
            *
    v23 i;
            goto 
    LABEL_48;
          }
        }
        else
        {
          if ( 
    v14 140 )
          {
            if ( 
    v14 104 )
            {
              
    v16 v14 110;
              
    v15 v16 == 0;
            }
            else
            {
              if ( 
    v14 == 104 )
              {
                
    v17 v5->m_stat.nSpeed_;
                goto 
    LABEL_45;
              }
              
    v16 v14 100;
              
    v15 v16 == 0;
            }
            if ( 
    v15 )
            {
              
    v17 v5->m_stat.nPowerUp_;
            }
            else
            {
              
    v18 v16 1;
              if ( 
    v18 )
              {
                
    v19 v18 1;
                if ( 
    v19 )
                {
                  if ( 
    v19 != )
                    goto 
    LABEL_47;
                  
    v17 v5->m_stat.nMGuardUp_;
                }
                else
                {
                  
    v17 v5->m_stat.nPGuardUp_;
                }
              }
              else
              {
                
    v17 v5->m_stat.nMagicUp_;
              }
            }
    LABEL_45:
            if ( !
    v17 || (v22 abs(100 v12->nX), abs(100 v17) < v22) )
              goto 
    LABEL_47;
            goto 
    LABEL_48;
          }
          if ( !
    v5->m_stat.nPImmune_ && !v5->m_stat.nMImmune_ )
            goto 
    LABEL_47;
        }
    LABEL_48:
        ++
    i;
        
    v30 += 16;
        if ( 
    >= nCount )
          break;
        
    v9 i;
        
    v4 0;
      }
      if ( 
    anPossible.)
      {
        
    v24 = *(anPossible.1);
        if ( 
    v24 )
        {
          
    v25 CRand32::Random(&g_rand);
          
    v26 anPossible.a[v25 v24];
          
    v27 v5->m_aSkillContext.a[v26].nSkillID;
          *
    nSkillCommand v27;
          
    v5->m_nSkillCommand v27;
          *
    nSLV v5->m_aSkillContext.a[v26].nSLV;
        }
      }
    LABEL_52:
      
    v32 = -1;
      
    ZArray<long>::RemoveAll(&anPossible);


  7. #7
    Account Upgraded | Title Enabled! ExtremeDevilz is offline
    MemberRank
    Apr 2008 Join Date
    647Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by kevintjuh93 View Post
    How is this not random?
    PHP Code:
    void __thiscall CMob::PrepareNextSkill(CMob *thisint *nSkillCommandint *nSLVint tCur)
    {
      
    int v4// edi@1
      
    CMob *v5// esi@1
      
    MobSkillInfo *v6// eax@2
      
    int v7// eax@3
      
    int v8// ecx@6
      
    int v9// edx@8
      
    MobSkillContext *v10// ebx@11
      
    MobSkillInfo *v11// ecx@12
      
    MOBSKILLLEVELDATA *v12// ecx@15
      
    int v13// eax@18
      
    signed int v14// eax@20
      
    bool v15// zf@24
      
    int v16// eax@24
      
    int v17// edi@25
      
    int v18// eax@28
      
    int v19// eax@29
      
    int v20// eax@38
      
    unsigned int *v21// eax@40
      
    int v22// ebx@46
      
    int *v23// eax@47
      
    unsigned int v24// edi@50
      
    unsigned int v25// eax@51
      
    int v26// eax@51
      
    int v27// ecx@51
      
    int nCount// [sp+8h] [bp-20h]@3
      
    ZArray<longanPossible// [sp+10h] [bp-18h]@8
      
    unsigned int v30// [sp+14h] [bp-14h]@9
      
    int i// [sp+18h] [bp-10h]@8
      
    int v32// [sp+24h] [bp-4h]@8

      
    v4 0;
      
    v5 this;
      *
    nSkillCommand 0;
      if ( 
    this->m_stat.nSealSkill_
        
    || (v6 this->m_pTemplate->aSkillInfo.a) == 0
        
    || (v7 = *((_DWORD *)v6 1), (nCount v7) == 0)
        || !
    this->m_bNextAttackPossible
        
    || this->m_nSkillCommand
        
    || (v8 this->m_tLastSkillUse) != && tCur v8 3000 )
        return;
      
    anPossible.0;
      
    v9 0;
      
    v32 0;
      
    0;
      if ( 
    v7 <= )
        goto 
    LABEL_52;
      
    v30 0;
      while ( 
    )
      {
        
    v10 = &v5->m_aSkillContext.a[v30 0x10];
        if ( (
    signed int)v30 >= v4 )
        {
          
    v11 v5->m_pTemplate->aSkillInfo.a;
          if ( 
    v11 != (MobSkillInfo *)v4 )
          {
            if ( (
    unsigned int)v9 < *((_DWORD *)v11 1) )
              
    v4 = (int)&v11[v9];
          }
        }
        
    v12 = &CSkillInfo::GetMobSkill(TSingleton<CSkillInfo>::ms_pInstance, *(_DWORD *)v4)->aLevelData.a[*(_DWORD *)(v4 4) - 1];
        if ( !
    v4
          
    || v12->nHPBelow && (double)v5->m_nHP / (double)v5->m_pTemplate->nMaxHP 100.0 > (double)v12->nHPBelow
          
    || (v13 v12->tInterval) != && v13 v10->tLastSkillUse tCur )
          goto 
    LABEL_48;
        
    v14 v10->nSkillID;
        if ( 
    v10->nSkillID 141 )
        {
          
    v20 v14 142;
          if ( !
    v20 )
          {
            
    v17 v5->m_stat.nHardSkin_;
            goto 
    LABEL_45;
          }
          if ( 
    v20 != 58 )
            goto 
    LABEL_47;
          
    v21 v12->adwTemplateID.a;
          if ( 
    v21 )
            
    v21 = (unsigned int *)*(v21 1);
          if ( (
    unsigned int)((char *)v21 v10->nSummoned) <= v12->nLimit )
          {
    LABEL_47:
            
    v23 ZArray<long>::InsertBefore(&anPossible, -1);
            *
    v23 i;
            goto 
    LABEL_48;
          }
        }
        else
        {
          if ( 
    v14 140 )
          {
            if ( 
    v14 104 )
            {
              
    v16 v14 110;
              
    v15 v16 == 0;
            }
            else
            {
              if ( 
    v14 == 104 )
              {
                
    v17 v5->m_stat.nSpeed_;
                goto 
    LABEL_45;
              }
              
    v16 v14 100;
              
    v15 v16 == 0;
            }
            if ( 
    v15 )
            {
              
    v17 v5->m_stat.nPowerUp_;
            }
            else
            {
              
    v18 v16 1;
              if ( 
    v18 )
              {
                
    v19 v18 1;
                if ( 
    v19 )
                {
                  if ( 
    v19 != )
                    goto 
    LABEL_47;
                  
    v17 v5->m_stat.nMGuardUp_;
                }
                else
                {
                  
    v17 v5->m_stat.nPGuardUp_;
                }
              }
              else
              {
                
    v17 v5->m_stat.nMagicUp_;
              }
            }
    LABEL_45:
            if ( !
    v17 || (v22 abs(100 v12->nX), abs(100 v17) < v22) )
              goto 
    LABEL_47;
            goto 
    LABEL_48;
          }
          if ( !
    v5->m_stat.nPImmune_ && !v5->m_stat.nMImmune_ )
            goto 
    LABEL_47;
        }
    LABEL_48:
        ++
    i;
        
    v30 += 16;
        if ( 
    >= nCount )
          break;
        
    v9 i;
        
    v4 0;
      }
      if ( 
    anPossible.)
      {
        
    v24 = *(anPossible.1);
        if ( 
    v24 )
        {
          
    v25 CRand32::Random(&g_rand);
          
    v26 anPossible.a[v25 v24];
          
    v27 v5->m_aSkillContext.a[v26].nSkillID;
          *
    nSkillCommand v27;
          
    v5->m_nSkillCommand v27;
          *
    nSLV v5->m_aSkillContext.a[v26].nSLV;
        }
      }
    LABEL_52:
      
    v32 = -1;
      
    ZArray<long>::RemoveAll(&anPossible);

    @kevintjuh93

    I cant seems to understand that very well I notice something

    if ( !v4
    || v12->nHPBelow && (double)v5->m_nHP / (double)v5->m_pTemplate->nMaxHP * 100.0 > (double)v12->nHPBelow
    || (v13 = v12->tInterval) != 0 && v13 + v10->tLastSkillUse - tCur > 0 )

    o.O whats is this ?

  8. #8
    while(true) spam(); kevintjuh93 is offline
    MemberRank
    Jun 2008 Join Date
    The NetherlandsLocation
    4,119Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by Multo View Post
    @kevintjuh93

    I cant seems to understand that very well I notice something

    if ( !v4
    || v12->nHPBelow && (double)v5->m_nHP / (double)v5->m_pTemplate->nMaxHP * 100.0 > (double)v12->nHPBelow
    || (v13 = v12->tInterval) != 0 && v13 + v10->tLastSkillUse - tCur > 0 )

    o.O whats is this ?
    It just check if your hp percentage is below 'HPBelow' in the wz or checks if the interval + elapsed time > 0.

  9. #9
    Account Upgraded | Title Enabled! AristoCat is offline
    MemberRank
    Apr 2012 Join Date
    947Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by kevintjuh93 View Post
    How is this not random?
    PHP Code:
    void __thiscall CMob::PrepareNextSkill(CMob *thisint *nSkillCommandint *nSLVint tCur)
    {
      
    int v4// edi@1
      
    CMob *v5// esi@1
      
    MobSkillInfo *v6// eax@2
      
    int v7// eax@3
      
    int v8// ecx@6
      
    int v9// edx@8
      
    MobSkillContext *v10// ebx@11
      
    MobSkillInfo *v11// ecx@12
      
    MOBSKILLLEVELDATA *v12// ecx@15
      
    int v13// eax@18
      
    signed int v14// eax@20
      
    bool v15// zf@24
      
    int v16// eax@24
      
    int v17// edi@25
      
    int v18// eax@28
      
    int v19// eax@29
      
    int v20// eax@38
      
    unsigned int *v21// eax@40
      
    int v22// ebx@46
      
    int *v23// eax@47
      
    unsigned int v24// edi@50
      
    unsigned int v25// eax@51
      
    int v26// eax@51
      
    int v27// ecx@51
      
    int nCount// [sp+8h] [bp-20h]@3
      
    ZArray<longanPossible// [sp+10h] [bp-18h]@8
      
    unsigned int v30// [sp+14h] [bp-14h]@9
      
    int i// [sp+18h] [bp-10h]@8
      
    int v32// [sp+24h] [bp-4h]@8

      
    v4 0;
      
    v5 this;
      *
    nSkillCommand 0;
      if ( 
    this->m_stat.nSealSkill_
        
    || (v6 this->m_pTemplate->aSkillInfo.a) == 0
        
    || (v7 = *((_DWORD *)v6 1), (nCount v7) == 0)
        || !
    this->m_bNextAttackPossible
        
    || this->m_nSkillCommand
        
    || (v8 this->m_tLastSkillUse) != && tCur v8 3000 )
        return;
      
    anPossible.0;
      
    v9 0;
      
    v32 0;
      
    0;
      if ( 
    v7 <= )
        goto 
    LABEL_52;
      
    v30 0;
      while ( 
    )
      {
        
    v10 = &v5->m_aSkillContext.a[v30 0x10];
        if ( (
    signed int)v30 >= v4 )
        {
          
    v11 v5->m_pTemplate->aSkillInfo.a;
          if ( 
    v11 != (MobSkillInfo *)v4 )
          {
            if ( (
    unsigned int)v9 < *((_DWORD *)v11 1) )
              
    v4 = (int)&v11[v9];
          }
        }
        
    v12 = &CSkillInfo::GetMobSkill(TSingleton<CSkillInfo>::ms_pInstance, *(_DWORD *)v4)->aLevelData.a[*(_DWORD *)(v4 4) - 1];
        if ( !
    v4
          
    || v12->nHPBelow && (double)v5->m_nHP / (double)v5->m_pTemplate->nMaxHP 100.0 > (double)v12->nHPBelow
          
    || (v13 v12->tInterval) != && v13 v10->tLastSkillUse tCur )
          goto 
    LABEL_48;
        
    v14 v10->nSkillID;
        if ( 
    v10->nSkillID 141 )
        {
          
    v20 v14 142;
          if ( !
    v20 )
          {
            
    v17 v5->m_stat.nHardSkin_;
            goto 
    LABEL_45;
          }
          if ( 
    v20 != 58 )
            goto 
    LABEL_47;
          
    v21 v12->adwTemplateID.a;
          if ( 
    v21 )
            
    v21 = (unsigned int *)*(v21 1);
          if ( (
    unsigned int)((char *)v21 v10->nSummoned) <= v12->nLimit )
          {
    LABEL_47:
            
    v23 ZArray<long>::InsertBefore(&anPossible, -1);
            *
    v23 i;
            goto 
    LABEL_48;
          }
        }
        else
        {
          if ( 
    v14 140 )
          {
            if ( 
    v14 104 )
            {
              
    v16 v14 110;
              
    v15 v16 == 0;
            }
            else
            {
              if ( 
    v14 == 104 )
              {
                
    v17 v5->m_stat.nSpeed_;
                goto 
    LABEL_45;
              }
              
    v16 v14 100;
              
    v15 v16 == 0;
            }
            if ( 
    v15 )
            {
              
    v17 v5->m_stat.nPowerUp_;
            }
            else
            {
              
    v18 v16 1;
              if ( 
    v18 )
              {
                
    v19 v18 1;
                if ( 
    v19 )
                {
                  if ( 
    v19 != )
                    goto 
    LABEL_47;
                  
    v17 v5->m_stat.nMGuardUp_;
                }
                else
                {
                  
    v17 v5->m_stat.nPGuardUp_;
                }
              }
              else
              {
                
    v17 v5->m_stat.nMagicUp_;
              }
            }
    LABEL_45:
            if ( !
    v17 || (v22 abs(100 v12->nX), abs(100 v17) < v22) )
              goto 
    LABEL_47;
            goto 
    LABEL_48;
          }
          if ( !
    v5->m_stat.nPImmune_ && !v5->m_stat.nMImmune_ )
            goto 
    LABEL_47;
        }
    LABEL_48:
        ++
    i;
        
    v30 += 16;
        if ( 
    >= nCount )
          break;
        
    v9 i;
        
    v4 0;
      }
      if ( 
    anPossible.)
      {
        
    v24 = *(anPossible.1);
        if ( 
    v24 )
        {
          
    v25 CRand32::Random(&g_rand);
          
    v26 anPossible.a[v25 v24];
          
    v27 v5->m_aSkillContext.a[v26].nSkillID;
          *
    nSkillCommand v27;
          
    v5->m_nSkillCommand v27;
          *
    nSLV v5->m_aSkillContext.a[v26].nSLV;
        }
      }
    LABEL_52:
      
    v32 = -1;
      
    ZArray<long>::RemoveAll(&anPossible);

    nothing is random unless the random is random

  10. #10
    <3 Dynamik is offline
    MemberRank
    Feb 2011 Join Date
    TorontoLocation
    532Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by AristoCat View Post
    nothing is random unless the random is random
    We all know what he meant. In terms of everyday language, pseudorandom is considered random.

  11. #11
    Account Upgraded | Title Enabled! AristoCat is offline
    MemberRank
    Apr 2012 Join Date
    947Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Quote Originally Posted by Dynamik View Post
    We all know what he meant. In terms of everyday language, pseudorandom is considered random.
    i cant speak everyday language

  12. #12
    Account Upgraded | Title Enabled! ExtremeDevilz is offline
    MemberRank
    Apr 2008 Join Date
    647Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    Thread Updated

    MoopleDev Rev 120 Updated

  13. #13
    <3 Dynamik is offline
    MemberRank
    Feb 2011 Join Date
    TorontoLocation
    532Posts

    Re: Full Mob Skill And Mob Attack GMS v75 - GMS ALike

    I am not sure if I would say it is way better than how it was written before, but it is certainly more accurate. Good work, I guess.



Advertisement