Código:
#include "StdAfx.h"
cBuffer Buffer;
bool cBuffer::Load()
{
Tokenizer Token;
TokenizerGroup Group;
TokenizerSection Section;
Token.ParseFile(std::string("./Data/Buffer.txt"), Group);
if (Group.GetSection(0, Section))
{
this->_Active = Section.Rows[0].GetInt(0) > 0 ? true : false;
this->_Vip = Section.Rows[0].GetInt(1);
this->_Level = Section.Rows[0].GetInt(2);
}
if (Group.GetSection(1, Section))
{
this->_Time = Section.Rows[0].GetInt(0);
this->_Attack = Section.Rows[0].GetInt(1);
this->_Defense = Section.Rows[0].GetInt(2);
}
return true;
}
void cBuffer::Elf(OBJECTSTRUCT* Npc, OBJECTSTRUCT* lpObj)
{
if (!this->_Active)
{
ChatTargetSend(Npc, "Fui desabilitado.", lpObj->m_Index);
return;
}
else if (Custom[lpObj->m_Index].VipCount < Buffer._Vip)
{
ChatTargetSend(Npc, "Sistema exclusivo para VIP.", lpObj->m_Index);
return;
}
else if (lpObj->Level > Buffer._Level)
{
ChatTargetSend(Npc, "Ya no presisas de mi ayuda.", lpObj->m_Index);
return;
}
lpObj->m_SkillAttack = lpObj->Level / 3 + Buffer._Attack;
lpObj->m_SkillAttackTime = Buffer._Time * 60000;
lpObj->m_ViewSkillState |= 8;
lpObj->m_ViewSkillState |= 0x2000000;
GCMagicAttackNumberSend(Npc, 28, lpObj->m_Index, true);
Sleep(1000);
lpObj->m_SkillDefense = lpObj->Level / 5 + Buffer._Defense;
lpObj->m_SkillDefenseTime = Buffer._Time * 60000;
lpObj->m_ViewSkillState |= 4;
lpObj->m_ViewSkillState |= 0x2000000;
GCMagicAttackNumberSend(Npc, 27, lpObj->m_Index, true);
ChatTargetSend(Npc, "He aumentado tu defensa y ataque.", lpObj->m_Index);
return;
}
Creditos: DarkAngeL ( FLAMETEAM / FIRETEAM / MAYKON )