Coders Chit-Chat

Page 2 of 2 FirstFirst 12
Results 16 to 29 of 29
  1. #16
    (293692665344 >> 8) Darn is offline
    True MemberRank
    Mar 2009 Join Date
    GermanyLocation
    429Posts

    Re: Coders Chit-Chat

    well, i have barely touched it but here is what i've got so far.

    Spoiler:

    Code:
    void __thiscall CParty::AllotExp(CParty *pParty, int *nAllExp, int nMonsterLevel, tagPOINT *ptPMonster)
    {
      void *EndIt; // eax MAPDST
      char *Pair; // eax
      char v11; // [esp+3Ch] [ebp-68h]
      int a2; // [esp+40h] [ebp-64h]
      char v13; // [esp+48h] [ebp-5Ch]
      char v14; // [esp+50h] [ebp-54h]
      char v15; // [esp+54h] [ebp-50h]
      char v16; // [esp+58h] [ebp-4Ch]
      char v17; // [esp+5Ch] [ebp-48h]
      int nBonusExp; // [esp+60h] [ebp-44h]
      int beginit; // [esp+64h] [ebp-40h]
      char BeginIt; // [esp+6Ch] [ebp-38h] MAPDST
      int nCount; // [esp+70h] [ebp-34h]
      int nLevelDiff; // [esp+74h] [ebp-30h] MAPDST
      int nTopLevel; // [esp+78h] [ebp-2Ch]
      CChar *pPartyMember; // [esp+7Ch] [ebp-28h]
      int nLevelAdd; // [esp+80h] [ebp-24h]
      void *v27; // [esp+84h] [ebp-20h]
      int Exp; // [esp+94h] [ebp-10h]
      std::map varC; // [esp+98h] [ebp-Ch]
    
    
    
    
      CIOCriticalSection::Enter(&pParty->m_lock);
      nLevelDiff = nMonsterLevel - pParty->m_nTopLevel;
      if ( nLevelDiff < 0 )
      {
        if ( abs(nLevelDiff) >= 20 )
          nLevelDiff = 20;
        else
          nLevelDiff = abs(nLevelDiff);
        *nAllExp = (*nAllExp - *nAllExp * (g_nReviseExpB[(pParty->m_nTopLevel - 1) / 10][nLevelDiff] / 100.0));
      }
      else
      {
        if ( nLevelDiff >= 20 )
          nLevelDiff = 20;
        *nAllExp = (*nAllExp * (g_nReviseExpA[(pParty->m_nTopLevel - 1) / 10][nLevelDiff] / 100.0) + *nAllExp);
      }
      if ( *nAllExp > 0 )
      {
        sub_41C7D0(&v27);
        nLevelAdd = 0;
        nCount = 0;
        Container::Find(pParty->m_vecParty);
        while ( 1 )
        {
          EndIt = Container::End(pParty->m_vecParty, &v16);
          if ( !Container::iterator::not_equal(&BeginIt, EndIt) )
            break;
          pPartyMember = Container::GetObject(&BeginIt)->vfptr;
          if ( CChar::IsNormal(pPartyMember) && PowDistance(&pPartyMember->m_ptPixel, ptPMonster) <= 640 )
          {
            if ( pParty->m_nTopLevel - pPartyMember->m_nLevel <= 20 )
              ++nCount;
            nLevelAdd += pPartyMember->m_nLevel;
            sub_41C840(&v27, &pPartyMember);
          }
          sub_420030(&v17, 0);
        }
        if ( nCount > 1 )
          *nAllExp = (*nAllExp * ((nCount - 1) / 10.0) + *nAllExp);
        sub_445C80(&varC);
        nTopLevel = pParty->m_nTopLevel;
        Container::Find(&v27);
        while ( 1 )
        {
          EndIt = Container::End(&v27, &v14);
          if ( !Container::iterator::not_equal(&BeginIt, EndIt) )
            break;
          pPartyMember = Container::GetObject(&BeginIt)->vfptr;
          Exp = (*nAllExp * (pPartyMember->m_nLevel / nLevelAdd));
          nLevelDiff = nTopLevel - pPartyMember->m_nLevel;
          if ( nLevelDiff <= 28 )
          {
            if ( nLevelDiff > 0 )
              Exp = (Exp - Exp * (g_nRevisePartyExp[nLevelDiff] / 100.0));
          }
          else
          {
            Exp = 0;
          }
          if ( Exp )
          {
            CIOObject::AddRef(&pPartyMember->ParantClass.vfptr, &pPartyMember->m_nFindRef);
            Pair = PairStdMap(&v13, &pPartyMember, &Exp);
            STLMap_Insert(&varC, &a2, Pair);
          }
          sub_420030(&v15, 0);
        }
        CIOCriticalSection::Leave(&pParty->m_lock);
        *nAllExp = 0;
        std::map::begin(&varC, &beginit);
        while ( 1 )
        {
          EndIt = Container::Find(&varC);
          if ( !Container::iterator::not_equal(&beginit, EndIt) )
            break;
          pPartyMember = *std::map::iterator::value(&beginit);
          Exp = *(std::map::iterator::value(&beginit) + 4);
          *nAllExp += Exp;
          nBonusExp = (CMainConfig::s_nEvent & 1) != 0 ? 0x64 : 0;
          if ( CChar::IsBState(pPartyMember, 0x8000000000i64)
            || CChar::IsBState(pPartyMember, 0x10000000000i64)
            || CChar::IsBState(pPartyMember, 0x20000000000i64) )
          {
            nBonusExp += 10;
          }
          if ( CChar::IsBState(pPartyMember, 2i64) )
          {
            nBonusExp += 30;
          }
          else if ( CChar::IsBState(pPartyMember, 1i64) )
          {
            nBonusExp += 30;
          }
          pPartyMember->ParantClass.vfptr->UpdateProperty(pPartyMember, P_EXP, P_INCREASE, (Exp + nBonusExp * Exp / 100));
          CIOObject::_Release(&pPartyMember->ParantClass.vfptr, &pPartyMember->m_nFindRef);
          sub_446090(&beginit, &v11, 0);
        }
        sub_4398F0(&varC);
        sub_44F580(&v27);
      }
      else
      {
        CIOCriticalSection::Leave(&pParty->m_lock);
      }
    }



    Spoiler:

    Code:
    int GetColorLevel(int nMonsterLevel, int nPlayerLevel){
     int nDiffLevel = (nMonsterLevel - nPlayerLevel);
     if (nDiffLevel < 0){
      if (abs(nDiffLevel) >= 20)
       nDiffLevel = 20;
      else
       nDiffLevel = abs(nDiffLevel);
      return g_nDLvB[(nPlayerLevel - 1) / 10][nDiffLevel];
     }else{
      if (nDiffLevel >= 20)
       nDiffLevel = 20;
      else
       nDiffLevel = nMonsterLevel - nPlayerLevel;
      return g_nDLvA[(nPlayerLevel - 1) / 10][nDiffLevel];
     }
     return 0;
    }
    
    
    
    
    void CMonsterReal::AllotTransformExp(int bParty, int nID){
     CPlayer *pPlayer;
     CParty *pParty;
     if (bParty){
      pParty = CParty::FindParty(nID);
      if (pParty){
       pParty->AllotTransformExp(this->m_nLevel, &this->m_ptPixel);
       pParty->Release();
      }
     }else{
      pPlayer = CPlayer::FindPlayer(nID);
      if (pPlayer){
       if (GetColorLevel(this->m_nLevel, pPlayer->m_nLevel) >= 3)
        pPlayer->UpdateTransformExp(0);
       pPlayer->Release(&pPlayer->m_nFindRef);
      }
     }
    }
    
    
    
    
    void CMonsterReal::Die(CChar *pChar, int bFatal, int *bParty, int *nKeyID){
     this->m_nCurHP = 0;
     pChar->InfoDie(this->m_nId, bFatal);
     int nBestID = 0;
     this->AllotExp(bParty, nKeyID, &nBestID);
     this->m_pInit->DropItem(this, *bParty, *nKeyID, nBestID, pChar->GetDropItemMask());
     this->CancelAllBuff();
     this->WriteInSight(S2C_ACTION, "db", this->m_nId, AT_DIE);
    }
    Last edited by Darn; 07-06-18 at 04:21 PM.

  2. #17
    Ultimate Member Chale001 is offline
    MemberRank
    Dec 2012 Join Date
    180Posts

    Re: Coders Chit-Chat

    Where can I find/track passive skills?
    Well, excuteskill can track these attackable skills.. but how about passive/buff skills that can be called on player's login for a boost or something, where does it get handled?

  3. #18
    (293692665344 >> 8) Darn is offline
    True MemberRank
    Mar 2009 Join Date
    GermanyLocation
    429Posts

    Re: Coders Chit-Chat

    Code:
    .text:0047FC00    ; public: void __thiscall CPlayerSkill::ExcutePassiveSkill(void)
    .text:0047FC50;public: void __cdecl CPlayerSkill::ExcutePassiveSkill(int, ...)
    
    
    
    
    void __thiscall CPlayerSkill::ExcutePassiveSkill(CPlayerSkill *this)
    {
     CSkill *pSkill; // [esp+4h] [ebp-8h]
     int i; // [esp+8h] [ebp-4h]
     for (i = 0; i < 84; ++i)
     {
      pSkill = this->m_pSkill[i];
      if (pSkill)
       pSkill->vfptr->ExcutePassive(this->m_pOwner, 0, 0);
     }
    }
    
    
    
    
    void CPlayerSkill::ExcutePassiveSkill(CPlayerSkill *this, ...)
    {
     CSkill *pSkill; // [esp+4h] [ebp-4h]
     int nSkill; // [esp+14h] [ebp+Ch]
     va_list vaList; // [esp+18h] [ebp+10h]
     va_start(vaList, this);
     nSkill = va_arg(vaList, _DWORD);
     pSkill = this->m_pSkill[nSkill];  if (pSkill)
      pSkill->vfptr->ExcutePassiveV(this->m_pOwner, vaList);
    }

  4. #19
    Ultimate Member Chale001 is offline
    MemberRank
    Dec 2012 Join Date
    180Posts

    Re: Coders Chit-Chat

    Thanks, talking about skills.. here are 2 useful functions i found (i think you already know them but i'll show them anyways)
    Check if a player doesnt have a skill:
    PHP Code:
    static int(__thiscall *CPlayerSkill__IsSkill)( int thispointerint a2) = (int(__thiscall*)(int thispointerpointerint a2))0x0044A940;
    if (!
    Server::CPlayer::CPlayerSkill__IsSkill(((int)PlayerPointer) + 624SkillID)) 
    ----
    Skill reading on player login (so incase you want to call off a skill while player is logging in):
    PHP Code:
    static void(__thiscall *SetSkill)(int Playerint SkillIDint a3) = (void(__thiscall*)(int Playerint SkillIDint a3))0x0047F6B0
    Last edited by Chale001; 17-06-18 at 08:21 PM.

  5. #20
    Ultimate Member Chale001 is offline
    MemberRank
    Dec 2012 Join Date
    180Posts

    Re: Coders Chit-Chat

    I need the following definitions for AllotEXP function
    ----------------------------
    g_nReviseExpB
    g_nReviseExpA
    ----------------------------
    Thank you.

  6. #21
    (293692665344 >> 8) Darn is offline
    True MemberRank
    Mar 2009 Join Date
    GermanyLocation
    429Posts

    Re: Coders Chit-Chat

    Quote Originally Posted by Chale001 View Post
    I need the following definitions for AllotEXP function
    ----------------------------
    g_nReviseExpB
    g_nReviseExpA
    ----------------------------
    Thank you.
    You can look up all thease static arrays inside the Main Server




    Spoiler:


    Code:
    
    .data:004D8528    ; int g_nReviseExpA[10][21]
    
    .data:004D8528 00+g_nReviseExpA   dd 0,0,0,25,25,25,25; 0
    
    .data:004D8528 00+                                        ; DATA XREF: CMonsterReal::AllotExp(int &,int &,int &)+1E4↑r
    
    .data:004D8528 00+                                        ; CParty::AllotExp(int &,int,tagPOINT &)+56↑r ...
    
    .data:004D8528 00+                dd 50,50,50,50,50,100,100; 7
    
    .data:004D8528 00+                dd 100,100,100,100,100,100,100; 14
    
    .data:004D8528 00+                dd 0,0,0,25,25,25,25; 21
    
    .data:004D8528 00+                dd 50,50,50,50,50,100,100; 28
    
    .data:004D8528 00+                dd 100,100,100,100,100,100,100; 35
    
    .data:004D8528 00+                dd 0,0,25,25,25,25,50; 42
    
    .data:004D8528 00+                dd 50,50,50,50,100,100,100; 49
    
    .data:004D8528 00+                dd 100,100,100,100,100,100,100; 56
    
    .data:004D8528 00+                dd 0,0,25,25,25,25,50; 63
    
    .data:004D8528 19+                dd 50,50,50,50,100,100,100; 70
    
    .data:004D8528 00+                dd 100,100,100,100,100,100,100; 77
    
    .data:004D8528 00+                dd 0,25,25,25,25,50,50; 84
    
    .data:004D8528 00+                dd 50,50,50,100,100,100,100; 91
    
    .data:004D8528 19+                dd 100,100,100,100,100,100,100; 98
    
    .data:004D8528 00+                dd 0,25,25,25,25,50,50; 105
    
    .data:004D8528 00+                dd 50,50,50,100,100,100,100; 112
    
    .data:004D8528 00+                dd 100,100,100,100,100,100,100; 119
    
    .data:004D8528 19+                dd 0,25,25,25,50,50,50; 126
    
    .data:004D8528 00+                dd 50,50,100,100,100,100,100; 133
    
    .data:004D8528 00+                dd 100,100,100,100,100,100,100; 140
    
    .data:004D8528 00+                dd 0,25,25,25,50,50,50; 147
    
    .data:004D8528 19+                dd 50,50,100,100,100,100,100; 154
    
    .data:004D8528 00+                dd 100,100,100,100,100,100,100; 161
    
    .data:004D8528 00+                dd 0,25,25,25,50,50,50; 168
    
    .data:004D8528 00+                dd 50,50,100,100,100,100,100; 175
    
    .data:004D8528 32+                dd 100,100,100,100,100,100,100; 182
    
    .data:004D8528 00+                dd 0,25,25,25,50,50,50; 189
    
    .data:004D8528 00+                dd 50,50,100,100,100,100,100; 196
    
    .data:004D8528 00+                dd 100,100,100,100,100,100,100; 203
    
    .data:004D8870    ; int g_nReviseExpB[10][21]
    
    .data:004D8870 00+?g_nReviseExpB@@3PAY0BF@HA dd 0, 25, 25, 25, 50, 50, 50; 0
    
    .data:004D8870 00+                                        ; DATA XREF: CMonsterReal::AllotExp(int &,int &,int &)+24C↑r
    
    .data:004D8870 00+                                        ; CParty::AllotExp(int &,int,tagPOINT &)+BB↑r ...
    
    .data:004D8870 00+                dd 100, 100, 100, 100, 100, 100, 100; 7
    
    .data:004D8870 19+                dd 100, 100, 100, 100, 100, 100, 100; 14
    
    .data:004D8870 00+                dd 0, 0, 25, 25, 25, 50, 50; 21
    
    .data:004D8870 00+                dd 50, 100, 100, 100, 100, 100, 100; 28
    
    .data:004D8870 00+                dd 100, 100, 100, 100, 100, 100, 100; 35
    
    .data:004D8870 19+                dd 0, 0, 0, 25, 25, 25, 50; 42
    
    .data:004D8870 00+                dd 50, 50, 100, 100, 100, 100, 100; 49
    
    .data:004D8870 00+                dd 100, 100, 100, 100, 100, 100, 100; 56
    
    .data:004D8870 00+                dd 0, 0, 0, 0, 25, 25, 25; 63
    
    .data:004D8870 19+                dd 50, 50, 50, 100, 100, 100, 100; 70
    
    .data:004D8870 00+                dd 100, 100, 100, 100, 100, 100, 100; 77
    
    .data:004D8870 00+                dd 0, 0, 0, 0, 0, 25, 25; 84
    
    .data:004D8870 00+                dd 25, 50, 50, 50, 100, 100, 100; 91
    
    .data:004D8870 32+                dd 100, 100, 100, 100, 100, 100, 100; 98
    
    .data:004D8870 00+                dd 0, 0, 0, 0, 0, 0, 25; 105
    
    .data:004D8870 00+                dd 25, 25, 50, 50, 50, 100, 100; 112
    
    .data:004D8870 00+                dd 100, 100, 100, 100, 100, 100, 100; 119
    
    .data:004D8870 32+                dd 0, 0, 0, 0, 0, 0, 0  ; 126
    
    .data:004D8870 00+                dd 25, 25, 25, 50, 50, 50, 100; 133
    
    .data:004D8870 00+                dd 100, 100, 100, 100, 100, 100, 100; 140
    
    .data:004D8870 00+                dd 0, 0, 0, 0, 0, 0, 0  ; 147
    
    .data:004D8870 32+                dd 0, 25, 25, 25, 50, 50, 50; 154
    
    .data:004D8870 00+                dd 100, 100, 100, 100, 100, 100, 100; 161
    
    .data:004D8870 00+                dd 0, 0, 0, 0, 0, 0, 0  ; 168
    
    .data:004D8870 00+                dd 0, 25, 25, 25, 50, 50, 50; 175
    
    .data:004D8870 64+                dd 100, 100, 100, 100, 100, 100, 100; 182
    
    .data:004D8870 00+                dd 0, 0, 0, 0, 0, 0, 0  ; 189
    
    .data:004D8870 00+                dd 0, 25, 25, 25, 50, 50, 50; 196
    
    .data:004D8870 00+                dd 100, 100, 100, 100, 100, 100, 100; 203
    
    .data:004D8BB8    ; int g_nRevisePartyExp[61]
    
    .data:004D8BB8 00+?g_nRevisePartyExp@@3PAHA dd 0, 0, 0, 0, 0, 0, 0
    
    .data:004D8BB8 00+                                        ; DATA XREF: CParty::AllotExp(int &,int,tagPOINT &)+278↑r
    
    .data:004D8BB8 00+                dd 0, 0, 0, 0, 10, 10, 20
    
    .data:004D8BB8 00+                dd 20, 30, 30, 40, 40, 50, 50
    
    .data:004D8BB8 00+                dd 60, 60, 70, 70, 80, 80, 90
    
    .data:004D8BB8 00+                dd 90, 100, 100, 100, 100, 100, 100
    
    .data:004D8BB8 00+                dd 100, 100, 100, 100, 100, 100, 100
    
    .data:004D8BB8 00+                dd 100, 100, 100, 100, 100, 100, 100
    
    .data:004D8BB8 00+                dd 100, 100, 100, 100, 100, 100, 100
    
    .data:004D8BB8 00+                dd 100, 100, 100, 100, 100
    
    




    Code:
    
    static int g_nReviseExpA[10][21] =
    
    {
    
     { 0, 0, 0, 25, 25, 25, 25, 50, 50, 50, 50, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100 },
    
     { 0, 0, 0, 25, 25, 25, 25, 50, 50, 50, 50, 50, 100, 100, 100, 100, 100, 100, 100, 100, 100 },
    
    ...
    
    ...
    
    



  7. #22
    Certified Database Admin Jangan is offline
    DeveloperRank
    Jul 2007 Join Date
    Amman, JordanLocation
    2,139Posts

    Re: Coders Chit-Chat

    Just wish people like http://forum.ragezone.com/members/243990.html and http://forum.ragezone.com/members/339184.html were still part of this community.
    STOP GETTING FOOLED BY IMPOSTERS
    I DO NOT HAVE/OWN/BUY/SELL files or anything related!

    !~Contribute Back To The Community~!
    Please
    Rep and Like the author!

  8. #23
    Yes, it's really me HuninHune is offline
      V.I.P  Rank
    Sep 2006 Join Date
    ::1Location
    1,112Posts

    Re: Coders Chit-Chat

    Quote Originally Posted by Jangan View Post
    Just wish people like http://forum.ragezone.com/members/243990.html and http://forum.ragezone.com/members/339184.html were still part of this community.
    DeathArt was all but kicked out for not being "nice" enough to leachers

    Bakabug imo got more credit than he deserved, the releases he made were advanced in comparison to the average Kal dev but overall not THAT impressive that I remember... He also never completed a single project that I remember.


    But just to toss some more names in KingIzu and Zen would be nice if they were back... both haven't even been on their skype/facebook that i knew them on in ages
    Much of what I say is merely my opinion. My incredibly accurate opinion.

    Quote Originally Posted by AMSK
    My brothers love to kalonline the server I am old husband with you

  9. #24
    Banned FlyingBurrito is offline
    BannedRank
    Jul 2016 Join Date
    189Posts

    Re: Coders Chit-Chat

    Quote Originally Posted by HuninHune View Post
    DeathArt was all but kicked out for not being "nice" enough to leachers

    Bakabug imo got more credit than he deserved, the releases he made were advanced in comparison to the average Kal dev but overall not THAT impressive that I remember... He also never completed a single project that I remember.


    But just to toss some more names in KingIzu and Zen would be nice if they were back... both haven't even been on their skype/facebook that i knew them on in ages
    HOLY SHIT A GHOST !!!!!!!!!!

    hey nice to see ya around again :)

    I see someone named Creative Zen in rankings around kal still but im guessing its probably not really him

  10. #25
    Yes, it's really me HuninHune is offline
      V.I.P  Rank
    Sep 2006 Join Date
    ::1Location
    1,112Posts

    Re: Coders Chit-Chat

    Quote Originally Posted by FlyingBurrito View Post
    HOLY SHIT A GHOST !!!!!!!!!!
    hey nice to see ya around again :)
    I see someone named Creative Zen in rankings around kal still but im guessing its probably not really him
    nice to be around again
    Mmmm, yeah doubt that's the same Zen.


    So, anyway, whats the current state of Kal dev? Whats everyone basing their work on? Last I was active people were starting to release addons with .dll plugins to extend the game... Looks like that's progressed to the norm? Where can i get a good repack with a base setup worth extending? Core 2016 repack from R3v0 what everyone is working with as a base these days? That shit back doored?
    Much of what I say is merely my opinion. My incredibly accurate opinion.

    Quote Originally Posted by AMSK
    My brothers love to kalonline the server I am old husband with you

  11. #26
    Ultimate Member Swiftdeath is offline
    MemberRank
    Jan 2016 Join Date
    181Posts

    Re: Coders Chit-Chat

    Quote Originally Posted by HuninHune View Post
    nice to be around again
    So, anyway, whats the current state of Kal dev? Whats everyone basing their work on? Last I was active people were starting to release addons with .dll plugins to extend the game... Looks like that's progressed to the norm? Where can i get a good repack with a base setup worth extending? Core 2016 repack from R3v0 what everyone is working with as a base these days? That shit back doored?
    Guess everybody is working with the source of revo's files atm.
    REAL 2016 Sources - Full Package

    and for those who can't code 99% are now based on Revo or Beshoy repacks.

  12. #27
    Yes, it's really me HuninHune is offline
      V.I.P  Rank
    Sep 2006 Join Date
    ::1Location
    1,112Posts

    Re: Coders Chit-Chat

    Quote Originally Posted by Swiftdeath View Post
    Guess everybody is working with the source of revo's files atm.
    REAL 2016 Sources - Full Package

    and for those who can't code 99% are now based on Revo or Beshoy repacks.
    Yeah, at a glance that's what it looked like.
    Those sources are complete source for r3vo's shit? I grabbed them first thing but haven't had time to look over the source...
    Much of what I say is merely my opinion. My incredibly accurate opinion.

    Quote Originally Posted by AMSK
    My brothers love to kalonline the server I am old husband with you

  13. #28
    Banned FlyingBurrito is offline
    BannedRank
    Jul 2016 Join Date
    189Posts

    Re: Coders Chit-Chat

    Quote Originally Posted by HuninHune View Post
    Yeah, at a glance that's what it looked like.
    Those sources are complete source for r3vo's shit? I grabbed them first thing but haven't had time to look over the source...
    yes they are very complete and all ready to compile.

    i also compiled a ready to use set of dlls but you know some people are skeptical soooo use them if you would like or compile your own from the source.

    its all there and ready to go

  14. #29
    Ultimate Member Chale001 is offline
    MemberRank
    Dec 2012 Join Date
    180Posts

    Re: Coders Chit-Chat

    I'm trying to figure where the level limit for "Monster drop" is ..
    For example after 28 levels you can't drop an item by a monster, where is that line stored? already checked ItemDrop, ItemDropEx, as well as CreateDropItem, CMonsterReal__Die.. any hint is welcome.



Page 2 of 2 FirstFirst 12

Advertisement