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!

[Development] Create new dynamic effect source

Skilled Illusionist
Joined
Jun 22, 2017
Messages
363
Reaction score
557
i leave source here for who want create new effect or make effect form highest season work on low version..

example effect form main season 13:

myheart - [Development] Create new dynamic effect source - RaGEZONE Forums


myheart - [Development] Create new dynamic effect source - RaGEZONE Forums

struct and code main season 6
Code:
#pragma pack(push, 1)
struct DYNAMIC_EFFECT_INFO    //(size: 132)
{
    /*+0*/  bool    Enable; //int
    BYTE gap1[3];
    /*+4*/  DWORD    EffectID;
    /*+8*/  DWORD    TextureID;
    /*+12*/  int  SubEffectID;
    /*+16*/  float    Scale;
    /*+20*/  VAngle    VecPos;
    /*+32*/  VAngle    WorldPos;
    /*+44*/  VAngle    Color;
    /*+56*/  float    Unknown56; //Alpha
    /*+60*/  DWORD    Unknown60;
    /*+64*/  ObjectModel    * m_Owner;
    /*+68*/  float    Unknown68; //
    /*+72*/  DWORD    Unknown72;
    /*+76*/  BYTE    Unknown76; //int
    BYTE Gap01[3];
    /*+80*/  float    Unknown80;
    /*+84*/  VAngle    Unknown84;
    /*+96*/  VAngle    Color2;
    /*+108*/    VAngle    VecPos2;
    BYTE Gap02[12];
};
#pragma pack(pop)

Offset
Code:
[COLOR=#a52a2a]//Main 1.04C: 0x8905508
//Main 1.04D/1.04E: 0x8907508[/COLOR]

code
DYNAMIC_EFFECT_INFO *m_DynamicEffectInfo = (DYNAMIC_EFFECT_INFO*)0x8905508;

int CEffect::DynamicEffectEx(DWORD ModelID, vec3_t VecPos, vec3_t WorldPos, vec3_t Color, int SubEffectID, float Scale, ObjectModel* lpModel)
{
DYNAMIC_EFFECT_INFO *lpEffect;

for (int i = 0; i < 3000; ++i)
{
lpEffect = &m_DynamicEffectInfo;
if (!lpEffect->Enable)
break;
}

if (!lpEffect)
{
return 0;
}

lpEffect->Enable = 1;
lpEffect->EffectID = ModelID;
lpEffect->TextureID = ModelID;
lpEffect->SubEffectID = SubEffectID;
lpEffect->VecPos.X = VecPos[0];
lpEffect->VecPos.Y = VecPos[1];
lpEffect->VecPos.Z = VecPos[2];
lpEffect->VecPos2.X = VecPos[0];
lpEffect->VecPos2.Y = VecPos[1];
lpEffect->VecPos2.Z = VecPos[2];
lpEffect->Color.X = Color[0];
lpEffect->Color.Y = Color[1];
lpEffect->Color.Z = Color[2];
lpEffect->Scale = Scale;
lpEffect->Unknown80 = 0.0;
lpEffect->Unknown60 = 2;
lpEffect->Unknown72 = 0;
lpEffect->m_Owner = lpModel;
lpEffect->Unknown68 = 0.0;
lpEffect->Unknown76 = 1;
lpEffect->WorldPos.X = WorldPos[0];
lpEffect->WorldPos.Y = WorldPos[1];
lpEffect->WorldPos.Z = WorldPos[2];
lpEffect->Unknown84.X = 0.0;
lpEffect->Unknown84.Y = 0.0;
lpEffect->Unknown84.Z = 0.0;

switch (lpEffect->EffectID)
{
case 32587: //Texture ID Main Season 13 -- Effect\\shiny06.jpg
if (lpEffect->SubEffectID)
{
if (lpEffect->SubEffectID > 0 && lpEffect->SubEffectID <= 3)
{
lpEffect->Unknown60 = GetLargeRand() % 11 + 20;
lpEffect->Unknown56 = 0.0;
lpEffect->Unknown68 = (float)(GetLargeRand() % 180);
lpEffect->Scale = Scale - (float)(GetLargeRand() % 6) * (Scale / 10.0f);

switch (lpEffect->SubEffectID)
{
case 1:
lpEffect->VecPos.X = (float)(GetLargeRand() % 31) - 15.0f + lpEffect->VecPos.X;
lpEffect->VecPos.Y = (float)(GetLargeRand() % 31) - 15.0f + lpEffect->VecPos.Y;
lpEffect->VecPos.Z = (float)(GetLargeRand() % 21) + 12.0f + lpEffect->VecPos.Z;
break;
case 2:
lpEffect->VecPos.X = (float)(GetLargeRand() % 31) / 30.0f * 40.0f - 20.0f + lpEffect->VecPos.X;
lpEffect->VecPos.Y = (float)(GetLargeRand() % 31) / 30.0f * 40.0f - 20.0f + lpEffect->VecPos.Y;
lpEffect->VecPos.Z = (float)(GetLargeRand() % 24) + 14.0f + lpEffect->VecPos.Z;
break;
case 3:
lpEffect->VecPos.X = (float)(GetLargeRand() % 31) / 30.0f * 70.0f - 35.0f + lpEffect->VecPos.X;
lpEffect->VecPos.Y = (float)(GetLargeRand() % 31) / 30.0f * 70.0f - 35.0f + lpEffect->VecPos.Y;
lpEffect->VecPos.Z = (float)(GetLargeRand() % 30) + 20.0f + lpEffect->VecPos.Z;
break;
}
}
else
{
switch (lpEffect->SubEffectID)
{
case 4:

break;
case 6:
lpEffect->Unknown60 = 15;
lpEffect->Unknown68 = (float)(GetLargeRand() % 360);
lpEffect->Unknown84.X = (float)-(GetLargeRand() % 2 - 1);
lpEffect->Unknown84.Y = (float)-(GetLargeRand() % 4);
lpEffect->Unknown84.Z = (float)-(GetLargeRand() % 4);
break;
case 7:
lpEffect->Scale = (float)(GetLargeRand() % 8 + 1) * 0.1 * Scale;
lpEffect->Unknown60 = GetLargeRand() % 20 + 20;
lpEffect->Unknown56 = 1.0f;
lpEffect->Unknown68 = (float)(GetLargeRand() % 180);
break;
}
}
}
else
{
lpEffect->Unknown60 = 18;
lpEffect->WorldPos.X = 45.0;
}
break; //return i; <---
}

return 0;
}
 
Last edited:
Joined
Jun 27, 2010
Messages
939
Reaction score
1,193
ObjectModel for 6.3 from zTeam source.
#pragma pack(push, 1)
struct ObjectModel //648? 848!!
{
BYTE gap00[4];
/*+4*/ BYTE Unknown4;
BYTE gap01[4];
/*+9*/ BYTE Unknown9;
BYTE gap02[2];
/*+12*/ BYTE Unknown12;
BYTE gap022[2];
/*+15*/ BYTE Unknown15;
BYTE gap03[2];
/*+18*/ WORD AnimationID;
/*+20*/ WORD Unknown20;
/*+22*/ BYTE Unknown22;
/*+23*/ BYTE Unknown23;
/*+24*/ BYTE ObjectType;
BYTE gap04[13];
/*+38*/ WORD Unknown38;
BYTE gap05[8];
/*+48*/ DWORD Unknown48;
BYTE gap06[44];
/*+96*/ float Scale;
BYTE gap07[16];
/*+116*/ float Unknown116;
BYTE gap08[20];
/*+140*/ float Unknown140;
/*+144*/ float Unknown144;
BYTE gap09[56];
/*+204*/ VAngle Unknown204;
/*+216*/ VAngle Unknown216;
BYTE gap10[24];
/*+252*/ float VecPosX;
/*+256*/ float VecPosY;
/*+260*/ float VecPosZ;
/*+264*/ float Unknown264;
/*+268*/ float Unknown268;
/*+272*/ float Unknown272;
BYTE gap11[148];
/*+424*/ ObjectModel_424 Unknown424;
BYTE gap12[176];
/*+484*/
};
#pragma pack(pop)

and some tests
myheart - [Development] Create new dynamic effect source - RaGEZONE Forums

myheart - [Development] Create new dynamic effect source - RaGEZONE Forums

--
myheart
maybe you can help me with this? this effect is "limited/fixed" on main s9 1.05.24(IGCN) by sub_92A1E9 and on main 1.04E should be sub_959B10 but the code of main 1.04E is different and the effect just looks like a total mess.

myheart - [Development] Create new dynamic effect source - RaGEZONE Forums
 
Last edited:
Newbie Spellweaver
Joined
Feb 12, 2012
Messages
60
Reaction score
2
Can you share struct ObjectModel?

Edit: Sorry I had not seen the post ashlay
 
Last edited:
Skilled Illusionist
Joined
Jun 22, 2017
Messages
363
Reaction score
557
maybe you can help me with this? this effect is "limited/fixed" on main s9 1.05.24(IGCN) by sub_92A1E9 and on main 1.04E should be sub_959B10 but the code of main 1.04E is different and the effect just looks like a total mess.

You can try this
Code:
float sub_4EC46D(float a1, float a2) //Main S13; //Decompiled
{
    float v5;

    float v2 = a2 * 0.01745f;
    float v6 = (float)((int)(v2 * 1000.0f / a1 + timeGetTime()) % (int)(6283.185546875f / a1))
  * 0.001f
  * a1;
    if (v6 >= 3.14f)
  v5 = cosf(v6);
    else
  v5 = -cosf(v6);
    return (float)((v5 + 1.0f) * 0.5f);
}

void sub_92A1E9(vec3_t a1, float a2) //Decompiled
{
    float v1 = a1[0] * a1[0] + a1[1] * a1[1] + a1[2] * a1[2];

    float v3 = sqrtf(v1);

    if (v3 < 0.000001f && v3 > -0.000001f)
    {
           a1[0] = 0.0;
           a1[1] = 0.0;
           a1[2] = 0.0;
    }
    else
    {
           float v2 = 1.0f / a2;

           a1[0] *= v2;
           a1[1] *= v2;
           a1[2] *= v2;
    }
}

Code:
int JointID[4] = { 14, 19, 37 ,42 };
float v213 = sub_4EC46D(10.0f, 0.0);

   Vector(1.0f, 0.55f, 0.05f, Color);

   if (v213 > 0.3f) // <- Change here may 0.4,0.5 is best
   {
    for (int i = 0; i < 4; i++)
    {
     gEffect.TransformPosition(Model, VecPos, lpModel, JointID[i], 0);
     WorldPos[0] = VecPos[0] - WorldPos[0];
     WorldPos[1] = VecPos[1] - WorldPos[1];
     WorldPos[2] = VecPos[2] - WorldPos[2];
     [COLOR=#a52a2a]sub_92A1E9(WorldPos, WorldPos[2]);[/COLOR]
     WorldPos[0] -= (0.25f - (float)(GetLargeRand() % 50) / 100.0f);
     WorldPos[2] -= (0.25f - (float)(GetLargeRand() % 50) / 100.0f);
     gEffect.DynamicEffectEx(TEXTURE_WATERFALL4, VecPos, WorldPos, Color, 17, 1.5f, lpModel);
    }
   }


myheart - [Development] Create new dynamic effect source - RaGEZONE Forums
 
Last edited:
Newbie Spellweaver
Joined
Mar 9, 2017
Messages
35
Reaction score
27
How can I use this in MUEMU SEASON 6, a guide to add it and compile it?
 
Back
Top