As you know, Taunt is a garbage ability. I already have an improved version of Taunt against mobs; I'll post it later. Okay, let's get to the new part. Now, Taunt affects players as long as it's a PK environment. The player will be forced to attack the caster of the taunt, and while under its effect, they won't be able to perform any route-based activities, attack others, use skills, etc, until the ability ends. Now this is a real taunt. Let's get to it.
Go Src/Libraries/common/include/NetCommand.h and add this:
Go Src/GameServer/src/Character.cpp and search function "bool CCharacter::AddSkillState" and below this
Add this :
Src/GameServer/src/Character.cpp add this :
Src/GameServer/src/Character.h add this inside "public:":
Now let's go to the CLIENT
Src/Client/src/NefIF.cpp inside "BOOL NetIF::HandlePacketMessage" add this:
Src/Client/src/PacketCmd_SC.cpp add this on top:
Src/Client/src/PacketCmd_SC.cpp add this :
Src/Client/src/PacketCmd.h add this:
Src/Client/src/UICommand.cpp search "CCommandObj::ExecRightClick" and just below this:
Add This:
}[/CODE]
Src/Client/src/PacketCmd.h add this:
Src/Client/src/UICommand.cpp search "CCommandObj::Exec" and just below this:
Add This:
Now let's go to the Server (Lua)
resource/script/calculate/skillefect.lua search "Skill_CHF_End" and delete this:
and Done Now Have a True PvP Taunt Skill
Go Src/Libraries/common/include/NetCommand.h and add this:
C++:
#define CMD_MC_FORCE_ATTACK CMD_MC_BASE + 119 //or an id free
Go Src/GameServer/src/Character.cpp and search function "bool CCharacter::AddSkillState" and below this
C++:
if (!m_CSkillState.Add(uchFightID, ulSrcWorldID, lSrcHandle, chObjType, chObjHabitat, chEffType, uchStateID, uchStateLv, GetTickCount(), lOnTick, chAddType))
return false;
C++:
//==============================
// FORCE ATTACK (TAUNT)
//==============================
const uChar STATE_TAUNT = 15;
if (uchStateID == STATE_TAUNT)
{
if (pCCha && pCCha != this)
{
pCCha->ForceAttackToCha(this);
}
}
Src/GameServer/src/Character.cpp add this :
C++:
void CCharacter::ForceAttackToCha(CCharacter* pCha)
{
if (!pCha)
return;
WPACKET pk = GETWPACKET();
WRITE_CMD(pk, CMD_MC_FORCE_ATTACK);
WRITE_LONG(pk, GetID());
WRITE_LONG(pk, GetHandle());
pCha->ReflectINFof(pCha, pk);
}
Src/GameServer/src/Character.h add this inside "public:":
C++:
void ForceAttackToCha(CCharacter* pCha);
Now let's go to the CLIENT
Src/Client/src/NefIF.cpp inside "BOOL NetIF::HandlePacketMessage" add this:
C++:
case CMD_MC_FORCE_ATTACK:
{
SC_ForceAttack(pk);
return TRUE;
}
Src/Client/src/PacketCmd_SC.cpp add this on top:
C++:
#include "WorldScene.h"
#include "MouseDown.h"
Src/Client/src/PacketCmd_SC.cpp add this :
C++:
void SC_ForceAttack(LPRPACKET pk)
{
DWORD id = pk.ReadLong();
CCharacter* pTarget = CGameApp::GetCurScene()->SearchByID(id);
if (!pTarget)
return;
CWorldScene* pScene = (CWorldScene*)CGameApp::GetCurScene();
if (!pScene)
return;
pScene->GetMouseDown().ForceAttack(pTarget);
}
Src/Client/src/PacketCmd.h add this:
C++:
extern void SC_ForceAttack(LPRPACKET pk);
Src/Client/src/UICommand.cpp search "CCommandObj::ExecRightClick" and just below this:
C++:
if( !CGameApp::GetCurScene() || !CGameScene::GetMainCha() )
return false;
C++:
CCharacter* pMain = CGameScene::GetMainCha();
// Block Taunt
if( pMain &&
pMain->GetStateMgr() &&
pMain->GetStateMgr()->HasSkillState(15) )
{
return false;
}
Src/Client/src/PacketCmd.h add this:
C++:
extern void SC_ForceAttack(LPRPACKET pk);
Src/Client/src/UICommand.cpp search "CCommandObj::Exec" and just below this:
C++:
if( !CGameApp::GetCurScene() || !CGameScene::GetMainCha() )
return false;
C++:
// Block Taunt
if( pMain &&
pMain->GetStateMgr() &&
pMain->GetStateMgr()->HasSkillState(15) )
{
return false;
}
Now let's go to the Server (Lua)
resource/script/calculate/skillefect.lua search "Skill_CHF_End" and delete this:
Rich (BB code):
if IsPlayer(defer) == 1 then
LG("Skill_CHF", "Victim as player")
SkillUnable(atker)
return
end
and Done Now Have a True PvP Taunt Skill
Attachments
Last edited: