Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: RuuneEfecto + MoldeEfecto  (Visto 2356 veces)

0 Miembros and 1 Guest are viewing this topic.

Offline erickmalfoy Posteado: January 08, 2024, 12:39:35 AM | Modificado: January 08, 2024, 12:52:35 AM by erickmalfoy

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 671
  • Gracias recibida: 720
  • ar
Bueno Al ver que Todos estan tirando la Casa por la ventana con los SRC El buen Amigo @OBBY  ME animo a ayudar con este granito de arena para todos los que estan aprendiendo a programar ya que yo aun estoy aprendiendo soy nuevo en estas cosas xD No soy programador Si en caso lo ve el codigo aun progamador xD lo hice A lo que entendi El codigo xDDD
Sin nada mas que decir Aqui viene:

Parte GameServer

RuneEffect.cpp

Spoiler for Hiden:
#include "stdafx.h"
#include "DSProtocol.h"
#include "Util.h"
#include "Message.h"
#include "User.h"
#include "Path.h"
#include "ServerInfo.h"
#include "MemScript.h"
#include "RuneEffect.h"
#include "Notice.h"

RuneEffect gRuneEffect;

void RuneEffect::GCRuneEffect(int aIndex, int aTargetIndex)
{
   if (gObjIsConnected(aIndex) == false || gObj[aTargetIndex].IsBot >= 1)
   {
      return;
   }
   // ---
   PMSG_CUSTOM_RUNEEFFECT pMsg = { 0 };
   // ---
   pMsg.h.set(0xF3, 0xEF, sizeof(pMsg));
   // ---
   // ---
   pMsg.iReset = gObj[aTargetIndex].Reset;
   pMsg.iMReset = gObj[aTargetIndex].MasterReset;
   pMsg.iLevel = gObj[aTargetIndex].Level;
   pMsg.iIndex = aTargetIndex;
   pMsg.cVip = gObj[aTargetIndex].AccountLevel;
   pMsg.cGM = gObj[aTargetIndex].Authority;
   pMsg.cPK = gObj[aTargetIndex].PKLevel;
   // ---
   DataSend(aIndex, (LPBYTE)&pMsg, pMsg.h.size);
   DataSend(aTargetIndex, (LPBYTE)&pMsg, pMsg.h.size);
}

RuneEfecto.h
Spoiler for Hiden:
struct PMSG_CUSTOM_RUNEEFFECT
{
   PSBMSG_HEAD h;
   int iIndex;
   int iLevel;
   int iReset;
   int iMReset;
   int cVip;
   int cGM;
   int cPK;
};
// ---
class RuneEffect
{
public:
   //void Load(char* path);
   void GCRuneEffect(int aIndex, int aTargetIndex);

private:
   int m_count;
};
extern RuneEffect gRuneEffect;
// ---

Buscan: DSPROTOCOL.CPP
   gCustomRankUser.GCReqRankLevelUser(lpObj->Index, lpObj->Index);

Pegan
   gRuneEffect.GCRuneEffect(lpObj->Index, lpObj->Index);

Busacan: Viewport
   gCustomRankUser.GCReqRankLevelUser(aIndex, gObj[n].Index);
Pega:
      gRuneEffect.GCRuneEffect(aIndex, gObj[n].Index);

stadafx.h
#include "RuneEffect.h"


Main.dll

HealthBar.cpp

Va al inicio
DWORD RunEffectTickTime[10] = { 0 };

Buscan
void DrawNewHealthBar()    //dentro de esto buscan

if (*(BYTE*)(ViewportAddress + 0x320) == 1)
   
Pegan:

Spoiler for Hiden:
//Rune Efecto 100%
int index = *(WORD*)(ViewportAddress + 0x7E);
ObjectPreview* Object = &*(ObjectPreview*)(ViewportAddress);

if (!pCheckEffectPlayer((DWORD*)(ViewportAddress + 0x4EC), 28))
{
   if (pPlayerState > 4)
   {
      for (std::vector<RuneEffectType>::iterator it = gRuneEffect.m_RuneEffectInfo.begin(); it != gRuneEffect.m_RuneEffectInfo.end(); it++)
      {
         if (gRuneEffect.m_RuneEffect[index].cGM != 32)
         {
            if (*(BYTE*)(ViewportAddress + 32) == 3) //pk
            {
               if (it->Index == 0) //FREE
               {
                  if ((GetTickCount() - RunEffectTickTime[index]) > it->Time)
                  {
                     if (gRuneEffect.m_RuneEffect[index].cVip == 0 && it->Type == 1)
                     {
                     gRuneEffect.RenderRuneEffect((int)&Object->m_Model, it->TextureIndex, it->Typo, it->Size);
                     RunEffectTickTime[index] = GetTickCount();

                     }
                   }
               }

               if (it->Index == 1) //VIP AL1
               {
                  if ((GetTickCount() - RunEffectTickTime[index]) > it->Time)
                  {

                  if (gRuneEffect.m_RuneEffect[index].cVip == 1 && it->Type == 1)
                  {
                     gRuneEffect.RenderRuneEffect((int)&Object->m_Model, it->TextureIndex, it->Typo, it->Size);
                     RunEffectTickTime[index] = GetTickCount();
                  }
                  }
               }
               
               if (it->Index == 2) //VIP AL2
               {
                  if ((GetTickCount() - RunEffectTickTime[index]) > it->Time)
                  {

                  if (gRuneEffect.m_RuneEffect[index].cVip == 2 && it->Type == 1)
                  {
                     gRuneEffect.RenderRuneEffect((int)&Object->m_Model, it->TextureIndex, it->Typo, it->Size);
                     RunEffectTickTime[index] = GetTickCount();
                  }
                  }
               }
               
               if (it->Index == 3) //VIP AL3
               {
                  if ((GetTickCount() - RunEffectTickTime[index]) > it->Time)
                  {
                  if (gRuneEffect.m_RuneEffect[index].cVip == 3 && it->Type == 1)
                  {
                     gRuneEffect.RenderRuneEffect((int)&Object->m_Model, it->TextureIndex, it->Typo, it->Size);
                     RunEffectTickTime[index] = GetTickCount();
                  }
                  }

               }
            }
            else
            {
               if (it->Index == 4) //PKLEVEL 6
               {
                  if ((GetTickCount() - RunEffectTickTime[index]) > it->Time)
                  {
                  if (*(BYTE*)(ViewportAddress + 32) == 6 && it->Type == 1)
                  {
                     gRuneEffect.RenderRuneEffect((int)&Object->m_Model, it->TextureIndex, it->Typo, it->Size);
                     RunEffectTickTime[index] = GetTickCount();
                  }
                  }
               }
            }
         }
      }
   }
}
else
{
   if (pPlayerState > 4)
   {
      for (std::vector<RuneEffectType>::iterator it = gRuneEffect.m_RuneEffectInfo.begin(); it != gRuneEffect.m_RuneEffectInfo.end(); it++)
      {
         if (it->Index == 5) //GAME MASTER
         {
            if ((GetTickCount() - RunEffectTickTime[index]) > it->Time)
            {
            if (it->Type == 1)
            {
               gRuneEffect.RenderRuneEffect((int)&Object->m_Model, it->TextureIndex, it->Typo, it->Size);
               RunEffectTickTime[index] = GetTickCount();
            }
            }
         }
      }
   }
}

RuneEffect.cpp //crean

Spoiler for Hiden:
#include "stdafx.h"
#include "RuneEffect.h"
#include "NewUIMyInventory.h"
#include "Object.h"
#include "Import.h"
#include "Defines.h"
//#include "Console.h"
#include "zzzmathlib.h"
#include "Util.h"
#include "ModelEffect.h"
#include "CustomPetEffect.h"




RuneEffect gRuneEffect;

RuneEffect::RuneEffect()
{
   this->m_RuneEffectInfo.clear();
}




void RuneEffect::LoadRuneEffect(RuneEffectType* info)
{
   for (int n = 0; n < MAX_TYPE_RUNEEFFECT; n++)
   {
      if (info[n].Index < 0 || info[n].Index >= MAX_TYPE_RUNEEFFECT)
      {
         return;
      }
      this->m_RuneEffectInfo.push_back(info[n]);
   }
}

void RuneEffect::GCRuneEffect(PMSG_CUSTOM_RUNEEFFECT* aRecv)
{
   if (aRecv == NULL)
   {
      return;
   }
   // ---
   this->m_RuneEffect[aRecv->iIndex].m_Level = aRecv->iLevel;
   this->m_RuneEffect[aRecv->iIndex].m_Resets = aRecv->iReset;
   this->m_RuneEffect[aRecv->iIndex].m_MResets = aRecv->iMReset;
   this->m_RuneEffect[aRecv->iIndex].cVip = aRecv->cVip;
   this->m_RuneEffect[aRecv->iIndex].cGM = aRecv->cGM;
   this->m_RuneEffect[aRecv->iIndex].cPK = aRecv->cPK;

   char Testando[200];
   wsprintf(Testando, "Vem Agora %d/%d", this->m_RuneEffect[aRecv->iIndex].cVip, aRecv->cVip);
   //Console.Write(Testando, 0, 0);
}

void RuneEffect::RenderRuneEffect(DWORD ObjectModel, int ID, int Typo, float Size)
{
   int Iterator = 0;

   MU3Float lBone[MAX_MODEL_EFFECT];

   MU3Float lBone2[MAX_MODEL_EFFECT];

   vec3_t Color;

   vec3_t ColorRandom;

   Vector(1.0, 1.0, 1.0, Color);

   Vector(((float)(rand() % 100) / 100), ((float)(rand() % 100) / 100), ((float)(rand() % 100) / 100), ColorRandom);

   lBone[Iterator].X = *(float*)(ObjectModel + 252);

   lBone[Iterator].Y = *(float*)(ObjectModel + 256);

   lBone[Iterator].Z = *(float*)(ObjectModel + 260);

   lBone2[Iterator].X = *(float*)(ObjectModel + 264);

   lBone2[Iterator].Y = *(float*)(ObjectModel + 268);

   lBone2[Iterator].Z = *(float*)(ObjectModel + 272);

   //lBone[Iterator].Z = lBone[Iterator].Z + (float)(Z);
   //
   //lBone2[Iterator].Z = lBone2[Iterator].Z + (float)(Z);
   //32378 2.0 Type: 2 //VIP
   //441 Type 1
   //32404 Type 1 //Admin
   //32313

   //pSkillEffect(ID, (int)&lBone, (int)&lBone2, Color, 2, 1, -1, 0, 0, 0, Size, -1);

   CreateEffect(ID, (int)&lBone, (int)&lBone2, ColorRandom, Typo, 0, -1, 0, 0, 0, Size, -1);

   

   //vec3_t vLight;
   //Vector(ColorR, ColorG, ColorB, vLight);
   //float fLumi = sinf(WorldTime * 0.0015f) * 0.3f + 0.5f;
   //Vector(fLumi * vLight[0], fLumi * vLight[1], fLumi * vLight[2], vLight);
   //EnableAlphaBlend();
   //RenderTerrainAlphaBitmap(ID, *(float*)(ObjectModel + 252), *(float*)(ObjectModel + 256), Size, Size, vLight, WorldTime * Speed, 1.0, FloorDistance, 1);
   //DisableAlphaBlend();


}

RuneEffect.h
Spoiler for Hiden:
#pragma once

#include <vector>

#define Hero                        *(DWORD*)0x007BC4F04
#define WorldTime                     *(float*)0x005EF5A1C
#define EnableAlphaBlend               ((void(__cdecl*)()) 0x636070)
#define DisableAlphaBlend               ((void(__cdecl*)()) 0x00635F50)
#define sub_4DB0E0                     ((BOOL(__cdecl*)(int a1))0x004DB0E0)
#define cRenderCharacter               ((void(__cdecl*)(ObjectPreview *a4, ObjectModel *a5, int Select)) 0x0057D260)
#define battleCastleInitEtcSetting         ((void(__cdecl*)()) 0x8CF360)
#define CreateBattleCastleCharacter_Visual   ((void(__cdecl*)(int a1, int a2)) 0x8CF360)
#define cSkillEffect                  ((void(__cdecl*)(int a1, int a2, int a3, float * a4, int a5, int a6, __int16 a7, __int16 a8, __int16 a9, __int16 a10, float a11, __int16 a12)) 0x6D9070)
#define RenderTerrainAlphaBitmap            ((void(__cdecl*)(int Texture,float xf,float yf,float SizeX,float SizeY,vec3_t Light,float Rotation,float Alpha,float Height, char a10)) 0x005DAD80)
#define sub_558630                     ((void(__cdecl*)(int a1, int a2, int a3)) 0x558630)
#define pCheckEffectPlayer               ((bool(__thiscall*)(void * This,char a2)) 0x004C8640)

#define MODEL_PLAYER         1163

#define MAX_TYPE_RUNEEFFECT 6

struct RuneEffectType
{
   int Index;
   int Type;
   int   TextureIndex;
   int   Typo;
   float Size;
   float Time;

};
//
struct PMSG_CUSTOM_RUNEEFFECT
{
   PSBMSG_HEAD h;
   int iIndex;
   int iLevel;
   int iReset;
   int iMReset;
   int cVip;
   int cGM;
   int cPK;
};
// ---
struct CUSTOM_RUNEEFFECT_DATA
{
   WORD m_Index;
   WORD m_Resets;
   WORD m_MResets;
   WORD m_Level;
   WORD cVip;
   WORD cGM;
   WORD cPK;
};
// ---
class RuneEffect
{
public:
   RuneEffect();
   // ---
   void GCRuneEffect(PMSG_CUSTOM_RUNEEFFECT* aRecv);
   //void RenderRuneEffect(DWORD ObjectModel, int ID, float Size, float ColorR, float ColorG, float ColorB, float Speed, float FloorDistance);
   void RenderRuneEffect(DWORD ObjectModel, int ID, int Typo, float Size);

   void LoadRuneEffect(RuneEffectType* info);
   void Init();
   CUSTOM_RUNEEFFECT_DATA m_RuneEffect[1000000]; //Mover si se te crashea el servidor
public:
   std::vector<RuneEffectType> m_RuneEffectInfo;
private:
   // ---
};
extern RuneEffect gRuneEffect;
// ---

Protocol.cpp
definen:
#include "RuneEffect.h"

Buscan
case 0xF3:
   switch(((lpMsg[0]==0xC1)?lpMsg[3]:lpMsg[4]))

pegan
  case 0xEF:
  gRuneEffect.GCRuneEffect((PMSG_CUSTOM_RUNEEFFECT*)lpMsg);
  break;


Main.cpp  //Recuerden siempre definir  #include "RuneEffect.h"

gRuneEffect.LoadRuneEffect(gProtect.m_MainInfo.m_RuneEffect);


Protect.h  //Recuerden siempre definir  #include "RuneEffect.h"

RuneEffectType m_RuneEffect[MAX_TYPE_RUNEEFFECT];

stdafx.h   Al final pegan
#include "BuffIcon.h"


GetMainInfo

RuneEffect.cpp
Spoiler for Hiden:
#include "stdafx.h"
#include "RuneEffect.h"
#include "MemScript.h"

RuneEffect gRuneEffect;

RuneEffect::RuneEffect()
{
   this->Init();
}
RuneEffect::~RuneEffect()
{

}

void RuneEffect::Init()
{
   for (int n = 0; n < MAX_TYPE_RUNEEFFECT; n++)
   {
      this->m_RuneEffect[n].Index = -1;
   };
}

void RuneEffect::Load(char* path)
{
   CMemScript* lpMemScript = new CMemScript;
   if (lpMemScript == 0)
   {
      printf(MEM_SCRIPT_ALLOC_ERROR, path);
      return;
   }
   if (lpMemScript->SetBuffer(path) == 0)
   {
      printf(lpMemScript->GetLastError());
      delete lpMemScript;
      return;
   }
   this->Init();
   try
   {
      while (true)
      {
         if (lpMemScript->GetToken() == TOKEN_END)
         {
            break;
         }
         if (strcmp("end", lpMemScript->GetString()) == 0)
         {
            break;
         }
         RuneEffectType info;
         memset(&info, 0, sizeof(info));
         static int CustomItemIndexCount = 0;
         info.Index = CustomItemIndexCount++;
         info.Type = lpMemScript->GetNumber();
         info.TextureIndex = lpMemScript->GetAsNumber();
         info.Typo = lpMemScript->GetAsNumber();
         info.Size = lpMemScript->GetAsNumber();
         info.Time = lpMemScript->GetAsNumber();
         this->SetInfo(info);
      }
   }
   catch (...)
   {
      printf(lpMemScript->GetLastError());
   }

   delete lpMemScript;
}

void RuneEffect::SetInfo(RuneEffectType info)
{
   if (info.Index < 0 || info.Index >= MAX_TYPE_RUNEEFFECT)
   {
      return;
   }

   this->m_RuneEffect[info.Index] = info;
}




RuneEffect.h


Spoiler for Hiden:
#pragma once

#define MAX_TYPE_RUNEEFFECT 6

struct RuneEffectType
{
   int Index;
   int Type;
   int   TextureIndex;
   int   Typo;
   float Size;
   float Time;

};

class RuneEffect
{
public:
   RuneEffect();
   ~RuneEffect();
   void Init();
   void Load(char* path);
   void SetInfo(RuneEffectType info);
public:
   RuneEffectType m_RuneEffect[MAX_TYPE_RUNEEFFECT];
};
extern RuneEffect gRuneEffect;



GetMainInfo.cpp
#include "RuneEffect.h"

RuneEffectType m_RuneEffect[MAX_TYPE_RUNEEFFECT];

gRuneEffect.Load("RuneEffect.txt");

memcpy(info.m_RuneEffect, gRuneEffect.m_RuneEffect, sizeof(info.m_RuneEffect));


Ahora el Text 

RuneEffect.txt

============
// Rune Effect Colores Variados
//32378 Clasico
//441 RUEDA
//32404 Agujero Negro de Colores
//32119 DEstellos alrrededor
// TipodeEfecto = 0 1 2
//================================================================================================================
//   Active     TextureIndex   TipodeEfecto Tamaño de Efecto  TimeEfecto  Requerido
   0         32378            2            1.0            400.0     //Account Free
   1         32378            2            1.0            400.0     //Account Vip 1
   1         32378            2            1.0            400.0     //Account Vip 2
   1         32378            2            1.0            400.0     //Account Vip 3
   1         32378            2            1.0            400.0     //Pk Level 6
   1         32378            2            1.0            400.0     //Game Master
end
Espero que Ayude a Varios Recuerden no soy Coder xD Gracias por compartir los SRC @OBBY De la GL e.E

So publico este codigo que lo tenia usando pero Lo cambie por uno Mejor ASi que Disfruten :D Aqui unas fotos

https://ibb.co/fHdjc8Z
https://ibb.co/ZK9P9sT
https://ibb.co/b6YLJD3





Online OBBY #1 Posteado: January 08, 2024, 10:59:43 AM

  • Colaborador
  • +1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 680
  • Gracias recibida: 13533
  • co
 aplausos gracias compañero. En horas a probar

Gracias:


Marcado como mejor respuesta por: erickmalfoy Posteado January 10, 2024, 06:47:18 PM

Online OBBY #2 Posteado: January 10, 2024, 10:37:28 PM

  • Colaborador
  • +1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 680
  • Gracias recibida: 13533
  • co
Unos detalles al codigo pero quedo... Gracias bro










Gracias:


Offline erickmalfoy #3 Posteado: January 10, 2024, 11:47:49 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 671
  • Gracias recibida: 720
  • ar
Unos detalles al codigo pero quedo... Gracias bro










que ese es mi codigo xDD tanto lo arreglaste e.E o toy mirando mal jajaja xD

Gracias:


Offline erickmalfoy #4 Posteado: January 10, 2024, 11:51:32 PM

  • 0 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 671
  • Gracias recibida: 720
  • ar
Unos detalles al codigo pero quedo... Gracias bro










ya no tienes problema con el mondeefecto y con tus demas custom :D Suerte bro para eso estamos muy pronto compartire otro codigo sobre las flag con fix de refresh y efectos dinamicos y estaticos u.U... !

Gracias:


Online OBBY #5 Posteado: January 11, 2024, 03:06:15 AM

  • Colaborador
  • +1 puntos por ventas
  • *
  • Rank: Puto amo
  • Posts: 680
  • Gracias recibida: 13533
  • co
Unos detalles al codigo pero quedo... Gracias bro










que ese es mi codigo xDD tanto lo arreglaste e.E o toy mirando mal jajaja xD


Ya tenía el codigo del rune pero tú código me sirvió para reestructurar algunas cosas más y lograr add otras 😁. Yo no utilizo el model ya que le tengo creada otra función...

Sería bueno seguir compartiendo

Gracias:


Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate