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!

damage floting

Initiate Mage
Joined
Jan 29, 2024
Messages
4
Reaction score
4
Hi, hello to all my dear RAGEZONE friends, I'm trying to create dmg floting and I'm having a bit of trouble. I thought I'd ask here with someone who can help me with this product code that I'm looking for. There's no problem paying him too, but there are some thieving programmers here who are stingy for money! And they exaggerate the prices, most of you may know them. I will not use the names of the thieves here in the forum, but very soon they will publish their names and the recordings of the conversations these thieves demand for this code! $200-300 does that make sense to you?



I want to say a huge thank you to all the people who post free codes and contribute to this forum! Especially for jorklenis2 <3
 
Junior Spellweaver
Joined
Dec 21, 2011
Messages
193
Reaction score
93
Hi, hello to all my dear RAGEZONE friends, I'm trying to create dmg floting and I'm having a bit of trouble. I thought I'd ask here with someone who can help me with this product code that I'm looking for. There's no problem paying him too, but there are some thieving programmers here who are stingy for money! And they exaggerate the prices, most of you may know them. I will not use the names of the thieves here in the forum, but very soon they will publish their names and the recordings of the conversations these thieves demand for this code! $200-300 does that make sense to you?



I want to say a huge thank you to all the people who post free codes and contribute to this forum! Especially for jorklenis2 <3
I'm doing floatdmg but I'm having a bit of trouble with where the damage number is displayed on the target. If anyone is interested

ZEffectManager.h
C++:
RMesh* m_pDamageFloat[10];
RMesh* m_pDamageFloatTest;
RMesh* m_pDmgPlus;
RMesh* m_pDmgMinus;

void AddDamageEffect(int Dmg, rvector& Target, rvector& TargetNormal);

ZEffectManager.cpp
C++:
for (int i = 0; i < 10; i++){
    char meshname[256];
    sprintf(meshname, "dmg%d", i);
    m_pDamageFloat[i] = m_pEffectMeshDmg->Get(meshname);
}


m_pEffectMeshDmg = new RMeshMgr;
if (m_pEffectMeshDmg->LoadXmlList("SFX/float_damage.xml") == -1) {
    mlog("float damage sfx loding error\n");
}

m_pDmgPlus = m_pEffectMeshDmg->Get("dmg+");
m_pDmgMinus = m_pEffectMeshDmg->Get("dmg-");


void ZEffectManager::AddDamageEffect(int Dmg, rvector& Target, rvector& TargetNormal)
{
    if (Dmg == 0)
        return;

    ZEffect* pNew = NULL;

    char buffer[32];
    sprintf(buffer, "%d", abs(Dmg));

    int nCount = (int)strlen(buffer);

    for (int i = 0; i < nCount; i++)
    {
        float fOffset = 1.0f * (float)(i - nCount + 2);
        pNew = new ZEffectSlash(m_pDamageFloat[buffer[i] - '0'], Target, TargetNormal);
        ((ZEffectSlash*)pNew)->SetScale(rvector(fOffset + 1.0f, 1.0f, 1.0f));
        ((ZEffectSlash*)pNew)->SetAlignType(1);
        Add(pNew);
    }

    float fOffset = 1.0f * (float)(3 - nCount);
    pNew = new ZEffectSlash(Dmg > 0 ? m_pDmgPlus : m_pDmgMinus, Target, TargetNormal);
    ((ZEffectSlash*)pNew)->SetScale(rvector(fOffset + 1.0f, 1.0f, 1.0f));
    ((ZEffectSlash*)pNew)->SetAlignType(1);
    Add(pNew);
}

ZGame.cpp
"inside"
C++:
void ZGame::OnPeerShot_Range(const MMatchCharItemParts sel_type, const MUID& uidOwner, float fShotTime, const rvector& pos, const rvector& to)
add
C++:
ZCharacter* pCharacter = ZGetGame()->m_pMyCharacter;
static int nLastDamage = 0;
int nCurrDamage = pCharacter->GetStatus().Ref().nRoundGivenDamage;

if (nCurrDamage != nLastDamage)
{
    nLastDamage = nCurrDamage;
    ZGetEffectManager()->AddDamageEffect(nLastDamage, v2, BulletMarkNormal);
}

client/sfx.mrs/float_damage.xml
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
    <AddEffectElu name="dmg-">
        <AddBaseModel name="dmg-" filename="dmg/ef_exp_-.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_-.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg+">
        <AddBaseModel name="dmg+" filename="dmg/ef_exp_+.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_+.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg0">
        <AddBaseModel name="dmg0" filename="dmg/ef_exp_num_0.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_0.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg1">
        <AddBaseModel name="dmg1" filename="dmg/ef_exp_num_1.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_1.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg2">
        <AddBaseModel name="dmg2" filename="dmg/ef_exp_num_2.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_2.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg3">
        <AddBaseModel name="dmg3" filename="dmg/ef_exp_num_3.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_3.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg4">
        <AddBaseModel name="dmg4" filename="dmg/ef_exp_num_4.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_4.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg5">
        <AddBaseModel name="dmg5" filename="dmg/ef_exp_num_5.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_5.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg6">
        <AddBaseModel name="dmg6" filename="dmg/ef_exp_num_6.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_6.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg7">
        <AddBaseModel name="dmg7" filename="dmg/ef_exp_num_7.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_7.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg8">
        <AddBaseModel name="dmg8" filename="dmg/ef_exp_num_8.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_8.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg9">
        <AddBaseModel name="dmg9" filename="dmg/ef_exp_num_9.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_9.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>

</xml>
 
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Jan 25, 2024
Messages
5
Reaction score
0
I'm doing floatdmg but I'm having a bit of trouble with where the damage number is displayed on the target. If anyone is interested

ZEffectManager.h
C++:
RMesh* m_pDamageFloat[10];
RMesh* m_pDamageFloatTest;
RMesh* m_pDmgPlus;
RMesh* m_pDmgMinus;

void AddDamageEffect(int Dmg, rvector& Target, rvector& TargetNormal);

ZEffectManager.cpp
C++:
for (int i = 0; i < 10; i++){
    char meshname[256];
    sprintf(meshname, "dmg%d", i);
    m_pDamageFloat[i] = m_pEffectMeshDmg->Get(meshname);
}


m_pEffectMeshDmg = new RMeshMgr;
if (m_pEffectMeshDmg->LoadXmlList("SFX/float_damage.xml") == -1) {
    mlog("float damage sfx loding error\n");
}

m_pDmgPlus = m_pEffectMeshDmg->Get("dmg+");
m_pDmgMinus = m_pEffectMeshDmg->Get("dmg-");


void ZEffectManager::AddDamageEffect(int Dmg, rvector& Target, rvector& TargetNormal)
{
    if (Dmg == 0)
        return;

    ZEffect* pNew = NULL;

    char buffer[32];
    sprintf(buffer, "%d", abs(Dmg));

    int nCount = (int)strlen(buffer);

    for (int i = 0; i < nCount; i++)
    {
        float fOffset = 1.0f * (float)(i - nCount + 2);
        pNew = new ZEffectSlash(m_pDamageFloat[buffer[i] - '0'], Target, TargetNormal);
        ((ZEffectSlash*)pNew)->SetScale(rvector(fOffset + 1.0f, 1.0f, 1.0f));
        ((ZEffectSlash*)pNew)->SetAlignType(1);
        Add(pNew);
    }

    float fOffset = 1.0f * (float)(3 - nCount);
    pNew = new ZEffectSlash(Dmg > 0 ? m_pDmgPlus : m_pDmgMinus, Target, TargetNormal);
    ((ZEffectSlash*)pNew)->SetScale(rvector(fOffset + 1.0f, 1.0f, 1.0f));
    ((ZEffectSlash*)pNew)->SetAlignType(1);
    Add(pNew);
}

ZGame.cpp
"inside"
C++:
void ZGame::OnPeerShot_Range(const MMatchCharItemParts sel_type, const MUID& uidOwner, float fShotTime, const rvector& pos, const rvector& to)
add
C++:
ZCharacter* pCharacter = ZGetGame()->m_pMyCharacter;
static int nLastDamage = 0;
int nCurrDamage = pCharacter->GetStatus().Ref().nRoundGivenDamage;

if (nCurrDamage != nLastDamage)
{
    nLastDamage = nCurrDamage;
    ZGetEffectManager()->AddDamageEffect(nLastDamage, v2, BulletMarkNormal);
}

client/sfx.mrs/float_damage.xml
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
    <AddEffectElu name="dmg-">
        <AddBaseModel name="dmg-" filename="dmg/ef_exp_-.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_-.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg+">
        <AddBaseModel name="dmg+" filename="dmg/ef_exp_+.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_+.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg0">
        <AddBaseModel name="dmg0" filename="dmg/ef_exp_num_0.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_0.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg1">
        <AddBaseModel name="dmg1" filename="dmg/ef_exp_num_1.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_1.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg2">
        <AddBaseModel name="dmg2" filename="dmg/ef_exp_num_2.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_2.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg3">
        <AddBaseModel name="dmg3" filename="dmg/ef_exp_num_3.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_3.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg4">
        <AddBaseModel name="dmg4" filename="dmg/ef_exp_num_4.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_4.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg5">
        <AddBaseModel name="dmg5" filename="dmg/ef_exp_num_5.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_5.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg6">
        <AddBaseModel name="dmg6" filename="dmg/ef_exp_num_6.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_6.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg7">
        <AddBaseModel name="dmg7" filename="dmg/ef_exp_num_7.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_7.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg8">
        <AddBaseModel name="dmg8" filename="dmg/ef_exp_num_8.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_8.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg9">
        <AddBaseModel name="dmg9" filename="dmg/ef_exp_num_9.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_9.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>

</xml>
Upload the "dmg" folder where the .elu and .ani are to be able to test the code, compare the result
 
Upvote 0
Newbie Spellweaver
Joined
Jan 25, 2024
Messages
5
Reaction score
0
utilizar exp elu ani
If you could send me the "dmg" folder I could solve the problem with the position, at the moment it is the only thing I need to test the code, I already have it added to the client, apparently without a problem but I do not have the .elu files and .ani
 
Upvote 0
Junior Spellweaver
Joined
Dec 21, 2011
Messages
193
Reaction score
93
If you could send me the "dmg" folder I could solve the problem with the position, at the moment it is the only thing I need to test the code, I already have it added to the client, apparently without a problem but I do not have the .elu files and .ani
find ef_exp_-.elu in interface/default
 
Upvote 0
Newbie Spellweaver
Joined
Dec 21, 2014
Messages
11
Reaction score
14
I'm doing floatdmg but I'm having a bit of trouble with where the damage number is displayed on the target. If anyone is interested

ZEffectManager.h
C++:
RMesh* m_pDamageFloat[10];
RMesh* m_pDamageFloatTest;
RMesh* m_pDmgPlus;
RMesh* m_pDmgMinus;

void AddDamageEffect(int Dmg, rvector& Target, rvector& TargetNormal);

ZEffectManager.cpp
C++:
for (int i = 0; i < 10; i++){
    char meshname[256];
    sprintf(meshname, "dmg%d", i);
    m_pDamageFloat[i] = m_pEffectMeshDmg->Get(meshname);
}


m_pEffectMeshDmg = new RMeshMgr;
if (m_pEffectMeshDmg->LoadXmlList("SFX/float_damage.xml") == -1) {
    mlog("float damage sfx loding error\n");
}

m_pDmgPlus = m_pEffectMeshDmg->Get("dmg+");
m_pDmgMinus = m_pEffectMeshDmg->Get("dmg-");


void ZEffectManager::AddDamageEffect(int Dmg, rvector& Target, rvector& TargetNormal)
{
    if (Dmg == 0)
        return;

    ZEffect* pNew = NULL;

    char buffer[32];
    sprintf(buffer, "%d", abs(Dmg));

    int nCount = (int)strlen(buffer);

    for (int i = 0; i < nCount; i++)
    {
        float fOffset = 1.0f * (float)(i - nCount + 2);
        pNew = new ZEffectSlash(m_pDamageFloat[buffer[i] - '0'], Target, TargetNormal);
        ((ZEffectSlash*)pNew)->SetScale(rvector(fOffset + 1.0f, 1.0f, 1.0f));
        ((ZEffectSlash*)pNew)->SetAlignType(1);
        Add(pNew);
    }

    float fOffset = 1.0f * (float)(3 - nCount);
    pNew = new ZEffectSlash(Dmg > 0 ? m_pDmgPlus : m_pDmgMinus, Target, TargetNormal);
    ((ZEffectSlash*)pNew)->SetScale(rvector(fOffset + 1.0f, 1.0f, 1.0f));
    ((ZEffectSlash*)pNew)->SetAlignType(1);
    Add(pNew);
}

ZGame.cpp
"inside"
C++:
void ZGame::OnPeerShot_Range(const MMatchCharItemParts sel_type, const MUID& uidOwner, float fShotTime, const rvector& pos, const rvector& to)
add
C++:
ZCharacter* pCharacter = ZGetGame()->m_pMyCharacter;
static int nLastDamage = 0;
int nCurrDamage = pCharacter->GetStatus().Ref().nRoundGivenDamage;

if (nCurrDamage != nLastDamage)
{
    nLastDamage = nCurrDamage;
    ZGetEffectManager()->AddDamageEffect(nLastDamage, v2, BulletMarkNormal);
}

client/sfx.mrs/float_damage.xml
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<xml>
    <AddEffectElu name="dmg-">
        <AddBaseModel name="dmg-" filename="dmg/ef_exp_-.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_-.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg+">
        <AddBaseModel name="dmg+" filename="dmg/ef_exp_+.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_+.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg0">
        <AddBaseModel name="dmg0" filename="dmg/ef_exp_num_0.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_0.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg1">
        <AddBaseModel name="dmg1" filename="dmg/ef_exp_num_1.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_1.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg2">
        <AddBaseModel name="dmg2" filename="dmg/ef_exp_num_2.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_2.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg3">
        <AddBaseModel name="dmg3" filename="dmg/ef_exp_num_3.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_3.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg4">
        <AddBaseModel name="dmg4" filename="dmg/ef_exp_num_4.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_4.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg5">
        <AddBaseModel name="dmg5" filename="dmg/ef_exp_num_5.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_5.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg6">
        <AddBaseModel name="dmg6" filename="dmg/ef_exp_num_6.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_6.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg7">
        <AddBaseModel name="dmg7" filename="dmg/ef_exp_num_7.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_7.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg8">
        <AddBaseModel name="dmg8" filename="dmg/ef_exp_num_8.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_8.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg9">
        <AddBaseModel name="dmg9" filename="dmg/ef_exp_num_9.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_9.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>

</xml>

I made a little improvement on this. (dmg floating using elu and ani)
but the problem regarding the horizontal movement of the elu's w2s has not yet been resolved.
Of course, if use text, it will be much easier to implement, but if use elu, you will be able to use more diverse designs and animations.
Instead, I changed the position data of the elu itself. (It's a little trick. lol)


Gunz -> ZEffectManager.h
C++:
    RMeshMgr* m_pEffectMeshDmg;
    RMesh* m_pDamageFloat[10];
    RMesh* m_pDamageFloatx[10];
    RMesh* m_pDamageFloatxx[10];

 
    void AddDamageEffect(int Dmg, ZObject* pObj, ZObject* pOwner);

Gunz -> ZeffectManager.cpp

Find
bool ZEffectManager::Create(void)

Add Inside
C++:
    m_pEffectMeshDmg = new RMeshMgr;
    if (m_pEffectMeshDmg->LoadXmlList("SFX/dmg/float_damage.xml") == -1) {
        mlog("float damage sfx loding error\n");
    }

    for (int i = 0; i < 10; i++)
    {
        char meshname[256];
        char meshnamex[256];
        char meshnamexx[256];
        sprintf(meshname, "dmg%d", i);
        m_pDamageFloat[i] = m_pEffectMeshDmg->Get(meshname);
        sprintf(meshnamex, "dmgx%d", i);
        m_pDamageFloatx[i] = m_pEffectMeshDmg->Get(meshnamex);
        sprintf(meshnamexx, "dmgxx%d", i);
        m_pDamageFloatxx[i] = m_pEffectMeshDmg->Get(meshnamexx);
    }

Add
C++:
void ZEffectManager::AddDamageEffect(int Dmg, ZObject* pObj, ZObject* pOwner)
{
    if (Dmg == 0) return;

    class ZEffectDmgfloating : public ZEffectIcon {
    public:
        ZEffectDmgfloating(RMesh* pMesh, ZObject* pObj)
            : ZEffectIcon(pMesh, pObj) {
        }

        virtual bool Draw(unsigned long int nTime)
        {
            ZObject* pObj = ZGetObjectManager()->GetObject(m_uid);

            ZCharacter* pChar = MDynamicCast(ZCharacter, pObj);

            if (pChar) {
                if (!pChar->m_bRendered) return true;
                if (!pChar->IsVisible()) return true;
                if (pObj->m_pVMesh) {
                    m_Pos = pObj->GetVisualMesh()->GetHeadPosition() + rvector(0, 0, 50); //  + rvector(0, 0, height)

                    RGetDevice()->SetRenderState(D3DRS_ZWRITEENABLE, TRUE);

                    ZEffectAniMesh::Draw(nTime);

                    RGetDevice()->SetRenderState(D3DRS_ZWRITEENABLE, FALSE);

                    return true;
                }
            }
            return false;
        }
    };

    ZEffect* pNew = NULL;

    char buffer[32];
    sprintf(buffer, "%d", abs(Dmg));
    int nCount = (int)strlen(buffer);
    float fScale, dist;

    float dx = pObj->GetPosition().x - pOwner->GetPosition().x;
    float dy = pObj->GetPosition().y - pOwner->GetPosition().y;
    float dz = pObj->GetPosition().z - pOwner->GetPosition().z;
    dist = sqrt(dx * dx + dy * dy + dz * dz);

    for (int i = 0; i < nCount; i++)
    {
        if (nCount == 3)
        {
            if (i == 0) {
                pNew = new ZEffectDmgfloating(m_pDamageFloat[buffer[i] - '0'], pObj);
                DeleteSameType((ZEffectAniMesh*)pNew);
            }
            if (i == 1)
                pNew = new ZEffectDmgfloating(m_pDamageFloatx[buffer[i] - '0'], pObj);
            if (i == 2)
                pNew = new ZEffectDmgfloating(m_pDamageFloatxx[buffer[i] - '0'], pObj);
        }
        if (nCount == 2)
        {
            if (i == 0) {
                pNew = new ZEffectDmgfloating(m_pDamageFloatx[buffer[i] - '0'], pObj);
                DeleteSameType((ZEffectAniMesh*)pNew);
            }
            if (i == 1)
                pNew = new ZEffectDmgfloating(m_pDamageFloatxx[buffer[i] - '0'], pObj);
        }
        if (nCount == 1)
        {
            if (i == 0) {
                pNew = new ZEffectDmgfloating(m_pDamageFloatx[buffer[i] - '0'], pObj);
                DeleteSameType((ZEffectAniMesh*)pNew);
            }
        }

        fScale = 1.0f + 0.001f * dist; //Size adjustment according to distance
        ((ZEffectDmgfloating*)pNew)->SetScale(rvector(fScale, fScale, fScale));
        Add(pNew);
    }
}

Gunz -> ZGame.h

Fine void OnPeerShotgun_Damaged(~~);

Change
C++:
void OnPeerShotgun_Damaged(ZObject* pOwner, float fShotTime, const rvector& pos, rvector& dir, ZPICKINFO pickinfo, DWORD dwPickPassFlag, rvector& v1, rvector& v2, ZItem* pItem, rvector& BulletMarkNormal, bool& bBulletMark, ZTargetType& nTargetType, bool& bHitEnemy, int Repeatcount);

Gunz -> ZGame.cpp

Find void ZGame::OnPeerShot_Range_Damaged

Add Inside
C++:
    if ((pObject->GetUID() != ZGetMyUID()) && (pOwner->GetUID() == ZGetMyUID()))
    {
        int nCurrDamage = ZGetGame()->m_pMyCharacter->GetStatus().Ref().nRoundGivenDamage;
        ZGetEffectManager()->AddDamageEffect(nCurrDamage, pObject, pOwner);
    }

Find void ZGame::OnPeerShotgun_Damaged

Change
C++:
void ZGame::OnPeerShotgun_Damaged(ZObject* pOwner, float fShotTime, const rvector& pos, rvector& dir, ZPICKINFO pickinfo, DWORD dwPickPassFlag, rvector& v1, rvector& v2, ZItem *pItem, rvector& BulletMarkNormal, bool& bBulletMark, ZTargetType& nTargetType, bool& bHitEnemy, int Repeatcount)

Add inside
C++:
if (Repeatcount == 0)
                ZGetGame()->m_pMyCharacter->GetStatus().Ref().nRoundGivenDamage = 0;
if (Repeatcount < SHOTGUN_BULLET_COUNT)
                ZGetGame()->m_pMyCharacter->GetStatus().Ref().nRoundGivenDamage += fActualDamage;


if ((pObject->GetUID() != ZGetMyUID()) && (pOwner->GetUID() == ZGetMyUID()) && (Repeatcount == SHOTGUN_BULLET_COUNT - 1))
            {
                int nCurrDamage = ZGetGame()->m_pMyCharacter->GetStatus().Ref().nRoundGivenDamage;
                ZGetEffectManager()->AddDamageEffect(nCurrDamage, pObject, pOwner);
            }

Melee
void ZGame::OnPeerShot_Melee

Explosion(Rocket, Grenade)
void ZGame::OnExplosionGrenade

SFX.mrs/dmg/float_damage.xml
XML:
    <!-- ė°ėÆøģ§€ķ”Œė”œķŒ… -->
    <AddEffectElu name="dmg0">
        <AddBaseModel name="dmg0" filename="dmg/ef_exp_num_0.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_0.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg1">
        <AddBaseModel name="dmg1" filename="dmg/ef_exp_num_1.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_1.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg2">
        <AddBaseModel name="dmg2" filename="dmg/ef_exp_num_2.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_2.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg3">
        <AddBaseModel name="dmg3" filename="dmg/ef_exp_num_3.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_3.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg4">
        <AddBaseModel name="dmg4" filename="dmg/ef_exp_num_4.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_4.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg5">
        <AddBaseModel name="dmg5" filename="dmg/ef_exp_num_5.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_5.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg6">
        <AddBaseModel name="dmg6" filename="dmg/ef_exp_num_6.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_6.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg7">
        <AddBaseModel name="dmg7" filename="dmg/ef_exp_num_7.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_7.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg8">
        <AddBaseModel name="dmg8" filename="dmg/ef_exp_num_8.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_8.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmg9">
        <AddBaseModel name="dmg9" filename="dmg/ef_exp_num_9.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_9.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx0">
        <AddBaseModel name="dmgx0" filename="dmg/ef_exp_num_x0.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x0.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx1">
        <AddBaseModel name="dmgx1" filename="dmg/ef_exp_num_x1.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x1.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx2">
        <AddBaseModel name="dmgx2" filename="dmg/ef_exp_num_x2.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x2.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx3">
        <AddBaseModel name="dmgx3" filename="dmg/ef_exp_num_x3.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x3.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx4">
        <AddBaseModel name="dmgx4" filename="dmg/ef_exp_num_x4.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x4.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx5">
        <AddBaseModel name="dmgx5" filename="dmg/ef_exp_num_x5.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x5.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx6">
        <AddBaseModel name="dmgx6" filename="dmg/ef_exp_num_x6.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x6.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx7">
        <AddBaseModel name="dmgx7" filename="dmg/ef_exp_num_x7.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x7.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx8">
        <AddBaseModel name="dmgx8" filename="dmg/ef_exp_num_x8.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x8.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgx9">
        <AddBaseModel name="dmgx9" filename="dmg/ef_exp_num_x9.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_x9.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx0">
        <AddBaseModel name="dmgxx0" filename="dmg/ef_exp_num_xx0.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx0.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx1">
        <AddBaseModel name="dmgxx1" filename="dmg/ef_exp_num_xx1.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx1.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx2">
        <AddBaseModel name="dmgxx2" filename="dmg/ef_exp_num_xx2.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx2.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx3">
        <AddBaseModel name="dmgxx3" filename="dmg/ef_exp_num_xx3.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx3.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx4">
        <AddBaseModel name="dmgxx4" filename="dmg/ef_exp_num_xx4.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx4.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx5">
        <AddBaseModel name="dmgxx5" filename="dmg/ef_exp_num_xx5.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx5.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx6">
        <AddBaseModel name="dmgxx6" filename="dmg/ef_exp_num_xx6.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx6.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx7">
        <AddBaseModel name="dmgxx7" filename="dmg/ef_exp_num_xx7.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx7.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx8">
        <AddBaseModel name="dmgxx8" filename="dmg/ef_exp_num_xx8.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx8.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>
    <AddEffectElu name="dmgxx9">
        <AddBaseModel name="dmgxx9" filename="dmg/ef_exp_num_xx9.elu" />
        <AddAnimation name="play" filename="dmg/ef_exp_num_xx9.elu.ani" motion_type="0" motion_loop_type="lastframe" />
    </AddEffectElu>

The code is a little dirty because I'm not good at coding. xD
And if anyone has any information about horizontal movement of the effect, please let me know.
 

Attachments

You must be registered for see attachments list
Last edited:
Upvote 0
Newbie Spellweaver
Joined
Jan 25, 2024
Messages
5
Reaction score
0
In this sense, the code only activates the damage float with a long-range machine gun and not with a shotgun.
 
Upvote 0
Newbie Spellweaver
Joined
Dec 21, 2014
Messages
11
Reaction score
14
can fix the bug with a simple, so try fixing the code when you use it.
:)

Shotgun_damaged <<
 
Upvote 0
Newbie Spellweaver
Joined
Jan 25, 2024
Messages
5
Reaction score
0
I already managed to correct all the problems and some bugs that even exist in the case of the NPCs when adding the effect with the katanas and grenades as it was shown in the quest, it was completely operational except for the displacement problem, I even adjusted the size of the effect.

The only thing that needs to be corrected is the problem with the movement, so that the effect is not shown above the character's head but instead floats to the right or left of the character depending on the angle and I think the code would be complete to share in a tutorial šŸ™ƒ
 
Last edited:
Upvote 0
Junior Spellweaver
Joined
Dec 21, 2011
Messages
193
Reaction score
93
I already managed to correct all the problems and some bugs that even exist in the case of the NPCs when adding the effect with the katanas and grenades as it was shown in the quest, it was completely operational except for the displacement problem, I even adjusted the size of the effect.

The only thing that needs to be corrected is the problem with the movement, so that the effect is not shown above the character's head but instead floats to the right or left of the character depending on the angle and I think the code would be complete to share in a tutorial šŸ™ƒ
maybe I did it the wrong way
 
Upvote 0
Back
Top