mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 02:31:03 +00:00
Rename namespace EQEmu to namespace EQ (so we don't have two similar but different namespaces anymore)
This commit is contained in:
+56
-56
@@ -303,8 +303,8 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
|
||||
//give NPCs skill values...
|
||||
int r;
|
||||
for (r = 0; r <= EQEmu::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = database.GetSkillCap(GetClass(), (EQEmu::skills::SkillType)r, moblevel);
|
||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = database.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, moblevel);
|
||||
}
|
||||
// some overrides -- really we need to be able to set skills for mobs in the DB
|
||||
// There are some known low level SHM/BST pets that do not follow this, which supports
|
||||
@@ -319,15 +319,15 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi
|
||||
}
|
||||
else {
|
||||
if (moblevel > 50) {
|
||||
skills[EQEmu::skills::SkillDoubleAttack] = 250;
|
||||
skills[EQEmu::skills::SkillDualWield] = 250;
|
||||
skills[EQ::skills::SkillDoubleAttack] = 250;
|
||||
skills[EQ::skills::SkillDualWield] = 250;
|
||||
}
|
||||
else if (moblevel > 3) {
|
||||
skills[EQEmu::skills::SkillDoubleAttack] = moblevel * 5;
|
||||
skills[EQEmu::skills::SkillDualWield] = skills[EQEmu::skills::SkillDoubleAttack];
|
||||
skills[EQ::skills::SkillDoubleAttack] = moblevel * 5;
|
||||
skills[EQ::skills::SkillDualWield] = skills[EQ::skills::SkillDoubleAttack];
|
||||
}
|
||||
else {
|
||||
skills[EQEmu::skills::SkillDoubleAttack] = moblevel * 5;
|
||||
skills[EQ::skills::SkillDoubleAttack] = moblevel * 5;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ void NPC::SetTarget(Mob* mob) {
|
||||
|
||||
if (owner) {
|
||||
auto client = owner->CastToClient();
|
||||
if (client->ClientVersionBit() & EQEmu::versions::maskUFAndLater) {
|
||||
if (client->ClientVersionBit() & EQ::versions::maskUFAndLater) {
|
||||
auto app = new EQApplicationPacket(OP_PetHoTT, sizeof(ClientTarget_Struct));
|
||||
auto ct = (ClientTarget_Struct *)app->pBuffer;
|
||||
ct->new_target = mob ? mob->GetID() : 0;
|
||||
@@ -592,8 +592,8 @@ void NPC::CheckMinMaxLevel(Mob *them)
|
||||
|
||||
if(themlevel < (*cur)->min_level || themlevel > (*cur)->max_level)
|
||||
{
|
||||
material = EQEmu::InventoryProfile::CalcMaterialFromSlot((*cur)->equip_slot);
|
||||
if (material != EQEmu::textures::materialInvalid)
|
||||
material = EQ::InventoryProfile::CalcMaterialFromSlot((*cur)->equip_slot);
|
||||
if (material != EQ::textures::materialInvalid)
|
||||
SendWearChange(material);
|
||||
|
||||
cur = itemlist.erase(cur);
|
||||
@@ -637,8 +637,8 @@ void NPC::QueryLoot(Client* to)
|
||||
continue;
|
||||
}
|
||||
|
||||
EQEmu::SayLinkEngine linker;
|
||||
linker.SetLinkType(EQEmu::saylink::SayLinkLootItem);
|
||||
EQ::SayLinkEngine linker;
|
||||
linker.SetLinkType(EQ::saylink::SayLinkLootItem);
|
||||
linker.SetLootData(*cur);
|
||||
|
||||
to->Message(
|
||||
@@ -790,7 +790,7 @@ bool NPC::Process()
|
||||
if (GetMana() < GetMaxMana()) {
|
||||
if (RuleB(NPC, UseMeditateBasedManaRegen)) {
|
||||
int32 npc_idle_mana_regen_bonus = 2;
|
||||
uint16 meditate_skill = GetSkill(EQEmu::skills::SkillMeditate);
|
||||
uint16 meditate_skill = GetSkill(EQ::skills::SkillMeditate);
|
||||
if (!IsEngaged() && meditate_skill > 0) {
|
||||
uint8 clevel = GetLevel();
|
||||
npc_idle_mana_regen_bonus =
|
||||
@@ -916,18 +916,18 @@ uint32 NPC::CountLoot() {
|
||||
|
||||
void NPC::UpdateEquipmentLight()
|
||||
{
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = 0;
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = 0;
|
||||
m_Light.Type[EQ::lightsource::LightEquipment] = 0;
|
||||
m_Light.Level[EQ::lightsource::LightEquipment] = 0;
|
||||
|
||||
for (int index = EQEmu::invslot::EQUIPMENT_BEGIN; index <= EQEmu::invslot::EQUIPMENT_END; ++index) {
|
||||
if (index == EQEmu::invslot::slotAmmo) { continue; }
|
||||
for (int index = EQ::invslot::EQUIPMENT_BEGIN; index <= EQ::invslot::EQUIPMENT_END; ++index) {
|
||||
if (index == EQ::invslot::slotAmmo) { continue; }
|
||||
|
||||
auto item = database.GetItem(equipment[index]);
|
||||
if (item == nullptr) { continue; }
|
||||
|
||||
if (EQEmu::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQEmu::lightsource::LightEquipment])) {
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = item->Light;
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
|
||||
if (EQ::lightsource::IsLevelGreater(item->Light, m_Light.Type[EQ::lightsource::LightEquipment])) {
|
||||
m_Light.Type[EQ::lightsource::LightEquipment] = item->Light;
|
||||
m_Light.Level[EQ::lightsource::LightEquipment] = EQ::lightsource::TypeToLevel(m_Light.Type[EQ::lightsource::LightEquipment]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -939,14 +939,14 @@ void NPC::UpdateEquipmentLight()
|
||||
if (!item->IsClassCommon()) { continue; }
|
||||
if (item->Light < 9 || item->Light > 13) { continue; }
|
||||
|
||||
if (EQEmu::lightsource::TypeToLevel(item->Light))
|
||||
if (EQ::lightsource::TypeToLevel(item->Light))
|
||||
general_light_type = item->Light;
|
||||
}
|
||||
|
||||
if (EQEmu::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQEmu::lightsource::LightEquipment]))
|
||||
m_Light.Type[EQEmu::lightsource::LightEquipment] = general_light_type;
|
||||
if (EQ::lightsource::IsLevelGreater(general_light_type, m_Light.Type[EQ::lightsource::LightEquipment]))
|
||||
m_Light.Type[EQ::lightsource::LightEquipment] = general_light_type;
|
||||
|
||||
m_Light.Level[EQEmu::lightsource::LightEquipment] = EQEmu::lightsource::TypeToLevel(m_Light.Type[EQEmu::lightsource::LightEquipment]);
|
||||
m_Light.Level[EQ::lightsource::LightEquipment] = EQ::lightsource::TypeToLevel(m_Light.Type[EQ::lightsource::LightEquipment]);
|
||||
}
|
||||
|
||||
void NPC::Depop(bool StartSpawnTimer) {
|
||||
@@ -1586,34 +1586,34 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
|
||||
return texture_profile_material;
|
||||
}
|
||||
|
||||
if (material_slot >= EQEmu::textures::materialCount) {
|
||||
if (material_slot >= EQ::textures::materialCount) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int16 invslot = EQEmu::InventoryProfile::CalcSlotFromMaterial(material_slot);
|
||||
int16 invslot = EQ::InventoryProfile::CalcSlotFromMaterial(material_slot);
|
||||
if (invslot == INVALID_INDEX) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (equipment[invslot] == 0) {
|
||||
switch (material_slot) {
|
||||
case EQEmu::textures::armorHead:
|
||||
case EQ::textures::armorHead:
|
||||
return helmtexture;
|
||||
case EQEmu::textures::armorChest:
|
||||
case EQ::textures::armorChest:
|
||||
return texture;
|
||||
case EQEmu::textures::armorArms:
|
||||
case EQ::textures::armorArms:
|
||||
return armtexture;
|
||||
case EQEmu::textures::armorWrist:
|
||||
case EQ::textures::armorWrist:
|
||||
return bracertexture;
|
||||
case EQEmu::textures::armorHands:
|
||||
case EQ::textures::armorHands:
|
||||
return handtexture;
|
||||
case EQEmu::textures::armorLegs:
|
||||
case EQ::textures::armorLegs:
|
||||
return legtexture;
|
||||
case EQEmu::textures::armorFeet:
|
||||
case EQ::textures::armorFeet:
|
||||
return feettexture;
|
||||
case EQEmu::textures::weaponPrimary:
|
||||
case EQ::textures::weaponPrimary:
|
||||
return d_melee_texture1;
|
||||
case EQEmu::textures::weaponSecondary:
|
||||
case EQ::textures::weaponSecondary:
|
||||
return d_melee_texture2;
|
||||
default:
|
||||
//they have nothing in the slot, and its not a special slot... they get nothing.
|
||||
@@ -1641,7 +1641,7 @@ uint32 NPC::GetMaxDamage(uint8 tlevel)
|
||||
|
||||
void NPC::PickPocket(Client* thief)
|
||||
{
|
||||
thief->CheckIncreaseSkill(EQEmu::skills::SkillPickPockets, nullptr, 5);
|
||||
thief->CheckIncreaseSkill(EQ::skills::SkillPickPockets, nullptr, 5);
|
||||
|
||||
//make sure were allowed to target them:
|
||||
int over_level = GetLevel();
|
||||
@@ -1661,7 +1661,7 @@ void NPC::PickPocket(Client* thief)
|
||||
return;
|
||||
}
|
||||
|
||||
int steal_skill = thief->GetSkill(EQEmu::skills::SkillPickPockets);
|
||||
int steal_skill = thief->GetSkill(EQ::skills::SkillPickPockets);
|
||||
int steal_chance = steal_skill * 100 / (5 * over_level + 5);
|
||||
|
||||
// Determine whether to steal money or an item.
|
||||
@@ -1671,7 +1671,7 @@ void NPC::PickPocket(Client* thief)
|
||||
|
||||
// still needs to have FindFreeSlot vs PutItemInInventory issue worked out
|
||||
while (steal_item) {
|
||||
std::vector<std::pair<const EQEmu::ItemData*, uint16>> loot_selection; // <const ItemData*, charges>
|
||||
std::vector<std::pair<const EQ::ItemData*, uint16>> loot_selection; // <const ItemData*, charges>
|
||||
for (auto item_iter : itemlist) {
|
||||
if (!item_iter || !item_iter->item_id)
|
||||
continue;
|
||||
@@ -1688,7 +1688,7 @@ void NPC::PickPocket(Client* thief)
|
||||
}
|
||||
|
||||
int random = zone->random.Int(0, (loot_selection.size() - 1));
|
||||
uint16 slot_id = thief->GetInv().FindFreeSlot(false, true, (loot_selection[random].first->Size), (loot_selection[random].first->ItemType == EQEmu::item::ItemTypeArrow));
|
||||
uint16 slot_id = thief->GetInv().FindFreeSlot(false, true, (loot_selection[random].first->Size), (loot_selection[random].first->ItemType == EQ::item::ItemTypeArrow));
|
||||
if (slot_id == INVALID_INDEX) {
|
||||
steal_item = false;
|
||||
break;
|
||||
@@ -1769,12 +1769,12 @@ void NPC::PickPocket(Client* thief)
|
||||
|
||||
void NPC::Disarm(Client* client, int chance) {
|
||||
// disarm primary if available, otherwise disarm secondary
|
||||
const EQEmu::ItemData* weapon = NULL;
|
||||
const EQ::ItemData* weapon = NULL;
|
||||
uint8 eslot = 0xFF;
|
||||
if (equipment[EQEmu::invslot::slotPrimary] != 0)
|
||||
eslot = EQEmu::invslot::slotPrimary;
|
||||
else if (equipment[EQEmu::invslot::slotSecondary] != 0)
|
||||
eslot = EQEmu::invslot::slotSecondary;
|
||||
if (equipment[EQ::invslot::slotPrimary] != 0)
|
||||
eslot = EQ::invslot::slotPrimary;
|
||||
else if (equipment[EQ::invslot::slotSecondary] != 0)
|
||||
eslot = EQ::invslot::slotSecondary;
|
||||
if (eslot != 0xFF) {
|
||||
if (zone->random.Int(0, 1000) <= chance) {
|
||||
weapon = database.GetItem(equipment[eslot]);
|
||||
@@ -1792,7 +1792,7 @@ void NPC::Disarm(Client* client, int chance) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
EQEmu::ItemInstance *inst = NULL;
|
||||
EQ::ItemInstance *inst = NULL;
|
||||
inst = database.CreateItem(weapon->ID, charges);
|
||||
// Remove item from loot table
|
||||
RemoveItem(weapon->ID);
|
||||
@@ -1808,19 +1808,19 @@ void NPC::Disarm(Client* client, int chance) {
|
||||
}
|
||||
// Update Appearance
|
||||
equipment[eslot] = 0;
|
||||
int matslot = eslot == EQEmu::invslot::slotPrimary ? EQEmu::textures::weaponPrimary : EQEmu::textures::weaponSecondary;
|
||||
int matslot = eslot == EQ::invslot::slotPrimary ? EQ::textures::weaponPrimary : EQ::textures::weaponSecondary;
|
||||
if (matslot != -1)
|
||||
SendWearChange(matslot);
|
||||
if ((CastToMob()->GetBodyType() == BT_Humanoid || CastToMob()->GetBodyType() == BT_Summoned) && eslot == EQEmu::invslot::slotPrimary)
|
||||
if ((CastToMob()->GetBodyType() == BT_Humanoid || CastToMob()->GetBodyType() == BT_Summoned) && eslot == EQ::invslot::slotPrimary)
|
||||
Say("Ahh! My weapon!");
|
||||
client->MessageString(Chat::Skills, DISARM_SUCCESS, this->GetCleanName());
|
||||
if (chance != 1000)
|
||||
client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 4);
|
||||
client->CheckIncreaseSkill(EQ::skills::SkillDisarm, nullptr, 4);
|
||||
return;
|
||||
}
|
||||
client->MessageString(Chat::Skills, DISARM_FAILED);
|
||||
if (chance != 1000)
|
||||
client->CheckIncreaseSkill(EQEmu::skills::SkillDisarm, nullptr, 2);
|
||||
client->CheckIncreaseSkill(EQ::skills::SkillDisarm, nullptr, 2);
|
||||
return;
|
||||
}
|
||||
client->MessageString(Chat::Skills, DISARM_FAILED);
|
||||
@@ -3236,8 +3236,8 @@ void NPC::AIYellForHelp(Mob *sender, Mob *attacker)
|
||||
void NPC::RecalculateSkills()
|
||||
{
|
||||
int r;
|
||||
for (r = 0; r <= EQEmu::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = database.GetSkillCap(GetClass(), (EQEmu::skills::SkillType)r, level);
|
||||
for (r = 0; r <= EQ::skills::HIGHEST_SKILL; r++) {
|
||||
skills[r] = database.GetSkillCap(GetClass(), (EQ::skills::SkillType)r, level);
|
||||
}
|
||||
|
||||
// some overrides -- really we need to be able to set skills for mobs in the DB
|
||||
@@ -3245,15 +3245,15 @@ void NPC::RecalculateSkills()
|
||||
// the theory of needing to be able to set skills for each mob separately
|
||||
if (!IsBot()) {
|
||||
if (level > 50) {
|
||||
skills[EQEmu::skills::SkillDoubleAttack] = 250;
|
||||
skills[EQEmu::skills::SkillDualWield] = 250;
|
||||
skills[EQ::skills::SkillDoubleAttack] = 250;
|
||||
skills[EQ::skills::SkillDualWield] = 250;
|
||||
}
|
||||
else if (level > 3) {
|
||||
skills[EQEmu::skills::SkillDoubleAttack] = level * 5;
|
||||
skills[EQEmu::skills::SkillDualWield] = skills[EQEmu::skills::SkillDoubleAttack];
|
||||
skills[EQ::skills::SkillDoubleAttack] = level * 5;
|
||||
skills[EQ::skills::SkillDualWield] = skills[EQ::skills::SkillDoubleAttack];
|
||||
}
|
||||
else {
|
||||
skills[EQEmu::skills::SkillDoubleAttack] = level * 5;
|
||||
skills[EQ::skills::SkillDoubleAttack] = level * 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user