Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
#ifndef _SPELL_UTIL_H_
|
||||
#define _SPELL_UTIL_H_
|
||||
|
||||
#include <Skill/Spell/Spell.h>
|
||||
#include <Creature/Monster/MonsterMgr.h>
|
||||
#include <Creature/Siege/SiegeConstants.h>
|
||||
|
||||
namespace Skill
|
||||
{
|
||||
template<typename Spell_t>
|
||||
class CAddSpell
|
||||
{
|
||||
public:
|
||||
|
||||
CAddSpell(const CSpell::Spell_Info& Spell_Info)
|
||||
: m_Spell_Info(Spell_Info)
|
||||
{
|
||||
}
|
||||
|
||||
unsigned short operator() (CAggresiveCreature* lpCharacter)
|
||||
{
|
||||
unsigned short wError = CSpell::NO_ENCHANT_ERROR;
|
||||
|
||||
if (NULL != lpCharacter)
|
||||
{
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> æƮ/<2F><>æƮ <20><><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7>װ<EFBFBD> <20>ִ<EFBFBD> <20>༮<EFBFBD><E0BCAE> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
Creature::CreatureType eCreatureType = Creature::GetCreatureType(lpCharacter->GetCID());
|
||||
if (Creature::CT_MONSTER == eCreatureType || Creature::CT_SUMMON == eCreatureType)
|
||||
{
|
||||
const CMonsterMgr::MonsterProtoType* lpProtoType =
|
||||
CMonsterMgr::GetInstance().GetMonsterProtoType(lpCharacter->GetCID() & Creature::MONSTER_KIND_BIT);
|
||||
|
||||
if (lpProtoType && lpProtoType->m_MonsterInfo.m_bIgnoreEnchant)
|
||||
{
|
||||
return wError;
|
||||
}
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> æƮ, <20><>æƮ<C3A6><C6AE> <20>ɸ<EFBFBD><C9B8><EFBFBD> <20>ʴ´<CAB4>.
|
||||
else if (Creature::CT_STRUCT == eCreatureType)
|
||||
{
|
||||
return CSpell::ENCHANT_FAIL_BY_RESIST;
|
||||
}
|
||||
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> æƮ, <20><>æƮ<C3A6><C6AE> <20>ɸ<EFBFBD><C9B8><EFBFBD> <20>ʴ´<CAB4>.
|
||||
else if (Creature::CT_SIEGE_OBJECT == eCreatureType)
|
||||
{
|
||||
// <20><> <20><>¡<EFBFBD><C2A1><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> æƮ<C3A6><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> æƮ, <20><>æƮ<C3A6><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
||||
if (!(Siege::EMBLEM == lpCharacter->GetObjectType() && Skill::SpellID::Invincible == m_Spell_Info.m_wSpellID))
|
||||
{
|
||||
return CSpell::ENCHANT_FAIL_BY_RESIST;
|
||||
}
|
||||
}
|
||||
|
||||
CSpell* lpSpell = new Spell_t(m_Spell_Info);
|
||||
|
||||
if (NULL != lpSpell)
|
||||
{
|
||||
if (true == lpSpell->AddAffected(lpCharacter, wError))
|
||||
{
|
||||
CGlobalSpellMgr::GetInstance().Add(lpSpell);
|
||||
return wError;
|
||||
}
|
||||
|
||||
delete lpSpell;
|
||||
}
|
||||
}
|
||||
|
||||
return wError;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
CSpell::Spell_Info m_Spell_Info;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user