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!

Let Knights wear an Shield with an 2 handed Weapon.

Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Hi ragezoners,

Yesterday i searched the net to find something that lets knights wear an Shield with an 2 handed weapon. I came accross this post from Kamote

http://forum.ragezone.com/f483/question-shields-890400/

Then i noticed that there was no tuturial about it so i decided to make one for you all.

Its rather simple to do this one. And no its not resourced controlled but source controlled.
So you need to have the source in order to do this part.

Well here we go

Open up MoverEquip.cpp

Now search for this part
if( pItemProp->dwItemKind3 == IK3_SHIELD )

In this section you need to change something to let it work for an knight or any other class with an 2 handed weapon.

After the if( pItemProp->dwItemKind3 == IK3_SHIELD ) {
We put in this

Code:
if(pMover->GetJob() != JOB_KNIGHT && pMover->GetJob() != JOB_KNIGHT_MASTER && pMover->GetJob() != JOB_KNIGHT_HERO && pMover->GetJob() != JOB_LORDTEMPLER_HERO )
{

and above the (else) we put in this ( } ) to close the ( if )

So the entire part look like this
#ifdef __2HANDED_SHIELD
if(pMover->GetJob() != JOB_KNIGHT && pMover->GetJob() != JOB_KNIGHT_MASTER && pMover->GetJob() != JOB_KNIGHT_HERO && pMover->GetJob() != JOB_LORDTEMPLER_HERO )
{
if( pHandItemProp && pHandItemProp->dwHanded == HD_TWO ) // ¼Õ¿¡ Áã°í ÀÖ´Â°Ô ÅõÇÚµå¸é.
{
if( pInventory )
{
CItemElem *pItemElemOld = pInventory->GetEquip( PARTS_RWEAPON );
if( pInventory->UnEquip( PARTS_RWEAPON ) == FALSE )
return FALSE;
#ifdef __WORLDSERVER
// ÅõÇÚµå ¹«±â¹þ±è
if( pItemElemOld )
{
ItemProp *pOldItemProp = pItemElemOld->GetProp();
pMover->ResetDestParamEquip( pOldItemProp, pItemElemOld );
g_UserMng.AddDoEquip( pMover, -1, pItemElemOld, FALSE );
}
#if __VER >= 9 // __ULTIMATE
prj.m_UltimateWeapon.SetDestParamUltimate( pMover, pItemElemOld, FALSE, PARTS_RWEAPON );
#endif // __ULTIMATE
#endif // worldserver
if( pEquipInfo )
pEquipInfo[PARTS_RWEAPON].dwId = NULL_ID;
} else
{
if( pEquipInfo )
pEquipInfo[PARTS_RWEAPON].dwId = NULL_ID;
}
pModel->TakeOffParts( PARTS_RWEAPON );
if( pHandItemProp->dwItemKind3 == IK3_YOYO ) // µé°í ÀÖ´ø ¹«±â°¡ ¿ä¿ä¿´À¸¸é
pModel->TakeOffParts( PARTS_LWEAPON ); // ¿Þ¼Õ¿¡ ÀÖ´ø ¿ä¿ä¸ðµ¨µµ ¾ø¾ÖÁØ´Ù.
}
}
#endif

As you may notice i defined it in the versioncommon.h of the neuz and worldserver
as this
#define __2HANDED_SHIELD

Now if you want to let Jesters/Ringmaster and or every other class that wears an 2 handed weapon also be aible to wear an shield then the only thing you have to change is this line

if(pMover->GetJob() != JOB_KNIGHT && pMover->GetJob() != JOB_KNIGHT_MASTER && pMover->GetJob() != JOB_KNIGHT_HERO && pMover->GetJob() != JOB_LORDTEMPLER_HERO )

You need then to enter more jobs for it. Remember to do it like this

pMover->GetJob() != JOB_RINGMASTER <-- see this ( != ) that means if its not the same.

Now after you have changed it rebuild the neuz and the worldserver to let it work.

There have fun with it.

@Credits
Kamote for giving the jump start
Shadowdragon for giving Kamote the Tips
Me for the tutorial.

With kind regards,

Loky.
 
Last edited:
Skilled Illusionist
Joined
Nov 21, 2012
Messages
390
Reaction score
213
Code:
#ifdef __2HANDED_SHIELD

if (pMover->GetJob() != JOB_KNIGHT && pMover->GetJob() != JOB_KNIGHT_MASTER && pMover->GetJob() != JOB_KNIGHT_HERO && pMover->GetJob() != JOB_LORDTEMPLER_HERO )
{
    if ( pHandItemProp && pHandItemProp->dwHanded == HD_TWO ) // ¼Õ¿¡ Áã°í ÀÖ´Â°Ô ÅõÇÚµå¸é.
    {
        if ( pInventory )
        {
            CItemElem *pItemElemOld = pInventory->GetEquip( PARTS_RWEAPON );
            if ( pInventory->UnEquip( PARTS_RWEAPON ) == FALSE ) 
            return FALSE;
            #ifdef __WORLDSERVER
            // ÅõÇÚµå ¹«±â¹þ±è
            if ( pItemElemOld )
            {
                ItemProp *pOldItemProp = pItemElemOld->GetProp();
                pMover->ResetDestParamEquip( pOldItemProp, pItemElemOld );
                g_UserMng.AddDoEquip( pMover, -1, pItemElemOld, FALSE );
            }
            #if __VER >= 9 // __ULTIMATE
            prj.m_UltimateWeapon.SetDestParamUltimate( pMover, pItemElemOld, FALSE, PARTS_RWEAPON );
            #endif // __ULTIMATE
            #endif // worldserver
            if ( pEquipInfo )
            pEquipInfo[PARTS_RWEAPON].dwId = NULL_ID;
            } else
            {
            if ( pEquipInfo )
            pEquipInfo[PARTS_RWEAPON].dwId = NULL_ID;
            }
        pModel->TakeOffParts( PARTS_RWEAPON );
        if ( pHandItemProp->dwItemKind3 == IK3_YOYO ) // µé°í ÀÖ´ø ¹«±â°¡ ¿ä¿ä¿´À¸¸é
        pModel->TakeOffParts( PARTS_LWEAPON ); // ¿Þ¼Õ¿¡ ÀÖ´ø ¿ä¿ä¸ðµ¨µµ ¾ø¾ÖÁØ´Ù.
    }    
}
#endif

Sorry, I hate not having proper spacing in the code.

Good tutorial though, thanks Loky!
 
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Thanks i could place it inside the [.code] [./code] but i used spoiler instead.
 
Skilled Illusionist
Joined
Nov 21, 2012
Messages
390
Reaction score
213
Wouldn't really help, FlyFF has the ugliest coding. I mean, come on. It's a block, inside of a block, inside of a block, inside of a block, inside of a block, inside of a block.
 
Not working on UnitedFlyf
Loyal Member
Joined
Apr 21, 2009
Messages
1,385
Reaction score
934
Alternative(and cleaner) method: Make two-handed Axe/Swords one-handed and job exclusive...
 
Skilled Illusionist
Joined
Nov 21, 2012
Messages
390
Reaction score
213
Alternative(and cleaner) method: Make two-handed Axe/Swords one-handed and job exclusive...

Wouldn't that remove the purpose of it being "two-handed"? Though, that's technically what Loky is doing here. I'd assume you'd being using arrays; or switches, right?
 
Joined
Nov 12, 2009
Messages
701
Reaction score
113
Wouldn't that remove the purpose of it being "two-handed"? Though, that's technically what Loky is doing here. I'd assume you'd being using arrays; or switches, right?

Uh, no. propItem.txt is all that would be needed to be changed, afaik.

No reason at all to delve into the source.
 
Owner
Loyal Member
Joined
May 13, 2011
Messages
1,497
Reaction score
157
Well sure it can be done in propItem/SpecItem

But if you make it there an one handed then you need to make additional changes for the skills to work.

So when you do it in the source like the one above then thats the only thing you need to do.
There fore if you have the source i think that one is easier then modify PropItem/SpecItem and additionaly the Skills.

But thats me.
 
Joined
Nov 12, 2009
Messages
701
Reaction score
113
Well sure it can be done in propItem/SpecItem

But if you make it there an one handed then you need to make additional changes for the skills to work.

So when you do it in the source like the one above then thats the only thing you need to do.
There fore if you have the source i think that one is easier then modify PropItem/SpecItem and additionaly the Skills.

But thats me.

You're right, it is a bit easier this way. If you use propItem/SpecItem then every knight weapon would need to be changed, but you would need to make sure you weren't changing any other class weapons to 1-handed, unless that was the desired goal.

And I never thought about the issues that would arise when using skills that require a specific weapon, oopsies.

Good point.
 
Newbie Spellweaver
Joined
Sep 8, 2011
Messages
67
Reaction score
252
Also, I'm pretty sure that they would not have the knight's mti while holding two handed weapons because it would be read as one handed weapons. You'll always look like a mercenary if you do it through the propitem/specitem/propskill without doing any other changes.

^ Not clarified. Just guessing.
 
Joined
Nov 12, 2009
Messages
701
Reaction score
113
Also, I'm pretty sure that they would not have the knight's mti while holding two handed weapons because it would be read as one handed weapons. You'll always look like a mercenary if you do it through the propitem/specitem/propskill without doing any other changes.

^ Not clarified. Just guessing.

I considered that but I don't think it's true. Not all one-handed weapons are held as mercenaries (think wands or knuckles) and not all two-handed weapons are held as knights (think staffs or bows). My guess would be that the stance is dependent on the class of the weapon as well as the handedness, or something else entirely.

Also not clarified, just guessing.
 
Elite Diviner
Joined
Mar 12, 2009
Messages
487
Reaction score
67
I considered that but I don't think it's true. Not all one-handed weapons are held as mercenaries (think wands or knuckles) and not all two-handed weapons are held as knights (think staffs or bows). My guess would be that the stance is dependent on the class of the weapon as well as the handedness, or something else entirely.

Also not clarified, just guessing.

The answer can be found at the end of mdlyrna.inc, where the movers are defined.
 
Newbie Spellweaver
Joined
Apr 16, 2014
Messages
15
Reaction score
0
why blade can equip a shield with 2 weapons ,even if it's not define in the parentheses??

or i'ts because knight and blade are have the same origin??
"Mercenary"

problem solve thanks
 
Last edited:
Back
Top