mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
More 'dictionary' updates..added 'constants' files to client translators..started replacement of hard-coded inventory values.
This commit is contained in:
+20
-20
@@ -824,17 +824,17 @@ void Client::AI_Process()
|
||||
|
||||
if(GetTarget() && !IsStunned() && !IsMezzed() && !GetFeigned()) {
|
||||
if(attack_timer.Check()) {
|
||||
Attack(GetTarget(), 13);
|
||||
Attack(GetTarget(), MainPrimary);
|
||||
if(GetTarget()) {
|
||||
if(CheckDoubleAttack()) {
|
||||
Attack(GetTarget(), 13);
|
||||
Attack(GetTarget(), MainPrimary);
|
||||
if(GetTarget()) {
|
||||
bool triple_attack_success = false;
|
||||
if((((GetClass() == MONK || GetClass() == WARRIOR || GetClass() == RANGER || GetClass() == BERSERKER)
|
||||
&& GetLevel() >= 60) || GetSpecialAbility(SPECATK_TRIPLE))
|
||||
&& CheckDoubleAttack(true))
|
||||
{
|
||||
Attack(GetTarget(), 13, true);
|
||||
Attack(GetTarget(), MainPrimary, true);
|
||||
triple_attack_success = true;
|
||||
}
|
||||
|
||||
@@ -848,8 +848,8 @@ void Client::AI_Process()
|
||||
if(MakeRandomInt(0, 100) < flurrychance)
|
||||
{
|
||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||
Attack(GetTarget(), 13, false);
|
||||
Attack(GetTarget(), 13, false);
|
||||
Attack(GetTarget(), MainPrimary, false);
|
||||
Attack(GetTarget(), MainPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ void Client::AI_Process()
|
||||
{
|
||||
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
|
||||
{
|
||||
Attack(GetTarget(), 13, false);
|
||||
Attack(GetTarget(), MainPrimary, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -903,10 +903,10 @@ void Client::AI_Process()
|
||||
|
||||
if(MakeRandomFloat(0.0, 1.0) < DualWieldProbability)
|
||||
{
|
||||
Attack(GetTarget(), 14);
|
||||
Attack(GetTarget(), MainSecondary);
|
||||
if(CheckDoubleAttack())
|
||||
{
|
||||
Attack(GetTarget(), 14);
|
||||
Attack(GetTarget(), MainSecondary);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1145,14 +1145,14 @@ void Mob::AI_Process() {
|
||||
if(IsNPC()) {
|
||||
int16 n_atk = CastToNPC()->GetNumberOfAttacks();
|
||||
if(n_atk <= 1) {
|
||||
Attack(target, 13);
|
||||
Attack(target, MainPrimary);
|
||||
} else {
|
||||
for(int i = 0; i < n_atk; ++i) {
|
||||
Attack(target, 13);
|
||||
Attack(target, MainPrimary);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Attack(target, 13);
|
||||
Attack(target, MainPrimary);
|
||||
}
|
||||
|
||||
if (target) {
|
||||
@@ -1164,16 +1164,16 @@ void Mob::AI_Process() {
|
||||
|| GetSpecialAbility(SPECATK_QUAD))
|
||||
//check double attack, this is NOT the same rules that clients use...
|
||||
&& RandRoll < (GetLevel() + NPCDualAttackModifier)) {
|
||||
Attack(target, 13);
|
||||
Attack(target, MainPrimary);
|
||||
// lets see if we can do a triple attack with the main hand
|
||||
//pets are excluded from triple and quads...
|
||||
if ((GetSpecialAbility(SPECATK_TRIPLE) || GetSpecialAbility(SPECATK_QUAD))
|
||||
&& !IsPet() && RandRoll < (GetLevel() + NPCTripleAttackModifier)) {
|
||||
Attack(target, 13);
|
||||
Attack(target, MainPrimary);
|
||||
// now lets check the quad attack
|
||||
if (GetSpecialAbility(SPECATK_QUAD)
|
||||
&& RandRoll < (GetLevel() + NPCQuadAttackModifier)) {
|
||||
Attack(target, 13);
|
||||
Attack(target, MainPrimary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1319,13 +1319,13 @@ void Mob::AI_Process() {
|
||||
float DualWieldProbability = (GetSkill(SkillDualWield) + GetLevel()) / 400.0f;
|
||||
if(MakeRandomFloat(0.0, 1.0) < DualWieldProbability)
|
||||
{
|
||||
Attack(target, 14);
|
||||
Attack(target, MainSecondary);
|
||||
if (CanThisClassDoubleAttack())
|
||||
{
|
||||
int32 RandRoll = MakeRandomInt(0, 99);
|
||||
if (RandRoll < (GetLevel() + 20))
|
||||
{
|
||||
Attack(target, 14);
|
||||
Attack(target, MainSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2024,7 +2024,7 @@ bool Mob::Flurry(ExtraAttackOptions *opts)
|
||||
int num_attacks = GetSpecialAbilityParam(SPECATK_FLURRY, 1);
|
||||
num_attacks = num_attacks > 0 ? num_attacks : RuleI(Combat, MaxFlurryHits);
|
||||
for (int i = 0; i < num_attacks; i++)
|
||||
Attack(target, 13, false, false, false, opts);
|
||||
Attack(target, MainPrimary, false, false, false, opts);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -2073,14 +2073,14 @@ bool Mob::Rampage(ExtraAttackOptions *opts)
|
||||
if (m_target == GetTarget())
|
||||
continue;
|
||||
if (CombatRange(m_target)) {
|
||||
Attack(m_target, 13, false, false, false, opts);
|
||||
Attack(m_target, MainPrimary, false, false, false, opts);
|
||||
index_hit++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (RuleB(Combat, RampageHitsTarget) && index_hit < rampage_targets)
|
||||
Attack(GetTarget(), 13, false, false, false, opts);
|
||||
Attack(GetTarget(), MainPrimary, false, false, false, opts);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2099,7 +2099,7 @@ void Mob::AreaRampage(ExtraAttackOptions *opts)
|
||||
index_hit = hate_list.AreaRampage(this, GetTarget(), rampage_targets, opts);
|
||||
|
||||
if(index_hit == 0) {
|
||||
Attack(GetTarget(), 13, false, false, false, opts);
|
||||
Attack(GetTarget(), MainPrimary, false, false, false, opts);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -349,7 +349,7 @@ void Object::Close() {
|
||||
ItemInst* container = this->m_inst;
|
||||
if(container != nullptr)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ITEMS_PER_BAG; i++)
|
||||
for (uint8 i = SUB_BEGIN; i < EmuConstants::ITEM_CONTAINER_SIZE; i++)
|
||||
{
|
||||
ItemInst* inst = container->PopItem(i);
|
||||
if(inst != nullptr)
|
||||
|
||||
+3
-3
@@ -454,9 +454,9 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
|
||||
|
||||
if(damage > 0 && (aabonuses.TwoHandBluntBlock || spellbonuses.TwoHandBluntBlock || itembonuses.TwoHandBluntBlock)
|
||||
&& (other->InFrontMob(this, other->GetX(), other->GetY()) || bShieldBlockFromRear)) {
|
||||
bool equiped2 = CastToClient()->m_inv.GetItem(13);
|
||||
bool equiped2 = CastToClient()->m_inv.GetItem(MainPrimary);
|
||||
if(equiped2) {
|
||||
uint8 TwoHandBlunt = CastToClient()->m_inv.GetItem(13)->GetItem()->ItemType;
|
||||
uint8 TwoHandBlunt = CastToClient()->m_inv.GetItem(MainPrimary)->GetItem()->ItemType;
|
||||
float bonusStaffBlock = 0.0f;
|
||||
if(TwoHandBlunt == ItemType2HBlunt) {
|
||||
|
||||
@@ -4055,7 +4055,7 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on,
|
||||
rangedattk = true;
|
||||
}
|
||||
|
||||
if (!weapon && hand == 11 && GetSpecialAbility(SPECATK_RANGED_ATK))
|
||||
if (!weapon && hand == MainRange && GetSpecialAbility(SPECATK_RANGED_ATK))
|
||||
rangedattk = true;
|
||||
|
||||
for (uint32 i = 0; i < MAX_PROCS; i++) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr) { return false; }
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
|
||||
+4
-4
@@ -159,8 +159,8 @@ void Client::CalcItemBonuses(StatBonuses* newbon) {
|
||||
}
|
||||
|
||||
//tribute items
|
||||
for (i = 0; i < MAX_PLAYER_TRIBUTES; i++) {
|
||||
const ItemInst* inst = m_inv[TRIBUTE_SLOT_START + i];
|
||||
for (i = 0; i < EmuConstants::TRIBUTE_SIZE; i++) {
|
||||
const ItemInst* inst = m_inv[EmuConstants::TRIBUTE_BEGIN + i];
|
||||
if(inst == 0)
|
||||
continue;
|
||||
AddItemBonuses(inst, newbon, false, true);
|
||||
@@ -544,7 +544,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
|
||||
|
||||
bool food = false;
|
||||
bool drink = false;
|
||||
for (i = 22; i <= 29; i++)
|
||||
for (i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_BAGS_BEGIN; i++)
|
||||
{
|
||||
if (food && drink)
|
||||
break;
|
||||
@@ -560,7 +560,7 @@ void Client::CalcEdibleBonuses(StatBonuses* newbon) {
|
||||
AddItemBonuses(inst, newbon);
|
||||
}
|
||||
}
|
||||
for (i = 251; i <= 330; i++)
|
||||
for (i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::GENERAL_BAGS_END; i++)
|
||||
{
|
||||
if (food && drink)
|
||||
break;
|
||||
|
||||
+51
-49
@@ -3304,7 +3304,7 @@ void Bot::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
||||
|
||||
int damage = 0;
|
||||
uint32 hate = 0;
|
||||
int Hand = 13;
|
||||
int Hand = MainPrimary;
|
||||
if (hate == 0 && weapon_damage > 1) hate = weapon_damage;
|
||||
|
||||
if(weapon_damage > 0){
|
||||
@@ -4103,7 +4103,7 @@ void Bot::PetAIProcess() {
|
||||
int32 RandRoll = MakeRandomInt(0, 99);
|
||||
if (botPet->CanThisClassDoubleAttack() && (RandRoll < (botPet->GetLevel() + NPCDualAttackModifier)))
|
||||
{
|
||||
if(botPet->Attack(botPet->GetTarget(), 13))
|
||||
if(botPet->Attack(botPet->GetTarget(), MainPrimary))
|
||||
{}
|
||||
}
|
||||
}
|
||||
@@ -4145,13 +4145,13 @@ void Bot::PetAIProcess() {
|
||||
float DualWieldProbability = (botPet->GetSkill(SkillDualWield) + botPet->GetLevel()) / 400.0f;
|
||||
DualWieldProbability -= MakeRandomFloat(0, 1);
|
||||
if(DualWieldProbability < 0){
|
||||
botPet->Attack(botPet->GetTarget(), 14);
|
||||
botPet->Attack(botPet->GetTarget(), MainSecondary);
|
||||
if (botPet->CanThisClassDoubleAttack())
|
||||
{
|
||||
int32 RandRoll = MakeRandomInt(0, 99);
|
||||
if (RandRoll < (botPet->GetLevel() + 20))
|
||||
{
|
||||
botPet->Attack(botPet->GetTarget(), 14);
|
||||
botPet->Attack(botPet->GetTarget(), MainSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8195,7 +8195,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
|
||||
}
|
||||
}
|
||||
else { //We do a single regular attack if we attack from the front without chaotic stab
|
||||
Attack(other, 13);
|
||||
Attack(other, MainPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12333,30 +12333,31 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
gearbot->BotRemoveEquipItem(slotId);
|
||||
gearbot->CalcBotStats();
|
||||
switch(slotId) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 20:
|
||||
case 21:
|
||||
case MainCharm:
|
||||
case MainEar1:
|
||||
case MainHead:
|
||||
case MainFace:
|
||||
case MainEar2:
|
||||
case MainNeck:
|
||||
case MainBack:
|
||||
case MainWrist1:
|
||||
case MainWrist2:
|
||||
case MainRange:
|
||||
case MainPrimary:
|
||||
case MainSecondary:
|
||||
case MainFinger1:
|
||||
case MainFinger2:
|
||||
case MainChest:
|
||||
case MainWaist:
|
||||
//case MainPowerSource:
|
||||
case MainAmmo:
|
||||
gearbot->Say("My %s is now unequipped.", equipped[slotId]);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 12:
|
||||
case 18:
|
||||
case 19:
|
||||
case MainShoulders:
|
||||
case MainArms:
|
||||
case MainHands:
|
||||
case MainLegs:
|
||||
case MainFeet:
|
||||
gearbot->Say("My %s are now unequipped.", equipped[slotId]);
|
||||
break;
|
||||
default:
|
||||
@@ -12365,30 +12366,31 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
|
||||
}
|
||||
else {
|
||||
switch(slotId) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 20:
|
||||
case 21:
|
||||
case MainCharm:
|
||||
case MainEar1:
|
||||
case MainHead:
|
||||
case MainFace:
|
||||
case MainEar2:
|
||||
case MainNeck:
|
||||
case MainBack:
|
||||
case MainWrist1:
|
||||
case MainWrist2:
|
||||
case MainRange:
|
||||
case MainPrimary:
|
||||
case MainSecondary:
|
||||
case MainFinger1:
|
||||
case MainFinger2:
|
||||
case MainChest:
|
||||
case MainWaist:
|
||||
//case MainPowerSource:
|
||||
case MainAmmo:
|
||||
c->GetTarget()->Say("My %s is already unequipped.", equipped[slotId]);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 12:
|
||||
case 18:
|
||||
case 19:
|
||||
case MainShoulders:
|
||||
case MainArms:
|
||||
case MainHands:
|
||||
case MainLegs:
|
||||
case MainFeet:
|
||||
c->GetTarget()->Say("My %s are already unequipped.", equipped[slotId]);
|
||||
break;
|
||||
default:
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false);
|
||||
virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
|
||||
+28
-26
@@ -4141,14 +4141,14 @@ void Client::UpdateLFP() {
|
||||
uint16 Client::GetPrimarySkillValue()
|
||||
{
|
||||
SkillUseTypes skill = HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
|
||||
bool equiped = m_inv.GetItem(13);
|
||||
bool equiped = m_inv.GetItem(MainPrimary);
|
||||
|
||||
if (!equiped)
|
||||
skill = SkillHandtoHand;
|
||||
|
||||
else {
|
||||
|
||||
uint8 type = m_inv.GetItem(13)->GetItem()->ItemType; //is this the best way to do this?
|
||||
uint8 type = m_inv.GetItem(MainPrimary)->GetItem()->ItemType; //is this the best way to do this?
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@@ -5702,7 +5702,7 @@ void Client::AddCrystals(uint32 Radiant, uint32 Ebon)
|
||||
SendCrystalCounts();
|
||||
}
|
||||
|
||||
// Processes a client request to inspect a SoF client's equipment.
|
||||
// Processes a client request to inspect a SoF+ client's equipment.
|
||||
void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
if(requestee && requester) {
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_InspectAnswer, sizeof(InspectResponse_Struct));
|
||||
@@ -5727,28 +5727,30 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
}
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(9999);
|
||||
inst = requestee->GetInv().GetItem(MainPowerSource);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[21], item->Name);
|
||||
insr->itemicons[21] = item->Icon;
|
||||
// we shouldn't do this..but, that's the way it's coded atm...
|
||||
// (this type of action should be handled exclusively in the client translator)
|
||||
strcpy(insr->itemnames[SoF::slots::MainPowerSource], item->Name);
|
||||
insr->itemicons[SoF::slots::MainPowerSource] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[21] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::slots::MainPowerSource] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
inst = requestee->GetInv().GetItem(21);
|
||||
inst = requestee->GetInv().GetItem(MainAmmo);
|
||||
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[22], item->Name);
|
||||
insr->itemicons[22] = item->Icon;
|
||||
strcpy(insr->itemnames[SoF::slots::MainAmmo], item->Name);
|
||||
insr->itemicons[SoF::slots::MainAmmo] = item->Icon;
|
||||
}
|
||||
else
|
||||
insr->itemicons[22] = 0xFFFFFFFF;
|
||||
insr->itemicons[SoF::slots::MainAmmo] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
strcpy(insr->text, requestee->GetInspectMessage().text);
|
||||
@@ -6277,8 +6279,8 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
made_npc->PR = GetPR();
|
||||
made_npc->Corrup = GetCorrup();
|
||||
// looks
|
||||
made_npc->texture = GetEquipmentMaterial(1);
|
||||
made_npc->helmtexture = GetEquipmentMaterial(0);
|
||||
made_npc->texture = GetEquipmentMaterial(MaterialChest);
|
||||
made_npc->helmtexture = GetEquipmentMaterial(MaterialHead);
|
||||
made_npc->haircolor = GetHairColor();
|
||||
made_npc->beardcolor = GetBeardColor();
|
||||
made_npc->eyecolor1 = GetEyeColor1();
|
||||
@@ -6289,9 +6291,9 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
made_npc->drakkin_heritage = GetDrakkinHeritage();
|
||||
made_npc->drakkin_tattoo = GetDrakkinTattoo();
|
||||
made_npc->drakkin_details = GetDrakkinDetails();
|
||||
made_npc->d_meele_texture1 = GetEquipmentMaterial(7);
|
||||
made_npc->d_meele_texture2 = GetEquipmentMaterial(8);
|
||||
for (int i = 0; i < _MaterialCount; i++) {
|
||||
made_npc->d_meele_texture1 = GetEquipmentMaterial(MaterialPrimary);
|
||||
made_npc->d_meele_texture2 = GetEquipmentMaterial(MaterialSecondary);
|
||||
for (int i = EmuConstants::MATERIAL_BEGIN; i <= EmuConstants::MATERIAL_END; i++) {
|
||||
made_npc->armor_tint[i] = GetEquipmentColor(i);
|
||||
}
|
||||
made_npc->loottable_id = 0;
|
||||
@@ -7829,17 +7831,17 @@ void Client::TickItemCheck()
|
||||
if(zone->tick_items.empty()) { return; }
|
||||
|
||||
//Scan equip slots for items
|
||||
for(i = 0; i <= 21; i++)
|
||||
for(i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan main inventory + cursor
|
||||
for(i = 22; i < 31; i++)
|
||||
for(i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::CURSOR; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
//Scan bags
|
||||
for(i = 251; i < 340; i++)
|
||||
for(i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::CURSOR_BAG_END; i++)
|
||||
{
|
||||
TryItemTick(i);
|
||||
}
|
||||
@@ -7863,9 +7865,9 @@ void Client::TryItemTick(int slot)
|
||||
}
|
||||
|
||||
//Only look at augs in main inventory
|
||||
if(slot > 21) { return; }
|
||||
if(slot > EmuConstants::EQUIPMENT_END) { return; }
|
||||
|
||||
for (int x = 0; x < EmuConstants::ITEM_COMMON_SIZE; ++x)
|
||||
for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x)
|
||||
{
|
||||
ItemInst * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) { continue; }
|
||||
@@ -7886,17 +7888,17 @@ void Client::TryItemTick(int slot)
|
||||
void Client::ItemTimerCheck()
|
||||
{
|
||||
int i;
|
||||
for(i = 0; i <= 21; i++)
|
||||
for(i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for(i = 22; i < 31; i++)
|
||||
for(i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::CURSOR; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
|
||||
for(i = 251; i < 340; i++)
|
||||
for(i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::CURSOR_BAG_END; i++)
|
||||
{
|
||||
TryItemTimer(i);
|
||||
}
|
||||
@@ -7918,11 +7920,11 @@ void Client::TryItemTimer(int slot)
|
||||
++it_iter;
|
||||
}
|
||||
|
||||
if(slot > 21) {
|
||||
if(slot > EmuConstants::EQUIPMENT_END) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int x = 0; x < EmuConstants::ITEM_COMMON_SIZE; ++x)
|
||||
for (int x = AUG_BEGIN; x < EmuConstants::ITEM_COMMON_SIZE; ++x)
|
||||
{
|
||||
ItemInst * a_inst = inst->GetAugment(x);
|
||||
if(!a_inst) {
|
||||
|
||||
+1
-1
@@ -214,7 +214,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false);
|
||||
virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return (GetRaid() ? true : false); }
|
||||
virtual bool HasGroup() { return (GetGroup() ? true : false); }
|
||||
|
||||
+12
-11
@@ -873,9 +873,9 @@ int16 Client::CalcAC() {
|
||||
|
||||
// Shield AC bonus for HeroicSTR
|
||||
if(itembonuses.HeroicSTR) {
|
||||
bool equiped = CastToClient()->m_inv.GetItem(14);
|
||||
bool equiped = CastToClient()->m_inv.GetItem(MainSecondary);
|
||||
if(equiped) {
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(14)->GetItem()->ItemType;
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(MainSecondary)->GetItem()->ItemType;
|
||||
if(shield == ItemTypeShield)
|
||||
displayed += itembonuses.HeroicSTR/2;
|
||||
}
|
||||
@@ -903,9 +903,9 @@ int16 Client::GetACMit() {
|
||||
|
||||
// Shield AC bonus for HeroicSTR
|
||||
if(itembonuses.HeroicSTR) {
|
||||
bool equiped = CastToClient()->m_inv.GetItem(14);
|
||||
bool equiped = CastToClient()->m_inv.GetItem(MainSecondary);
|
||||
if(equiped) {
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(14)->GetItem()->ItemType;
|
||||
uint8 shield = CastToClient()->m_inv.GetItem(MainSecondary)->GetItem()->ItemType;
|
||||
if(shield == ItemTypeShield)
|
||||
mitigation += itembonuses.HeroicSTR/2;
|
||||
}
|
||||
@@ -1127,7 +1127,7 @@ uint32 Client::CalcCurrentWeight() {
|
||||
ItemInst* ins;
|
||||
uint32 Total = 0;
|
||||
int x;
|
||||
for(x = 0; x <= 30; x++)
|
||||
for(x = EmuConstants::EQUIPMENT_BEGIN; x <= EmuConstants::CURSOR; x++) // include cursor or not?
|
||||
{
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
@@ -1136,7 +1136,7 @@ uint32 Client::CalcCurrentWeight() {
|
||||
if (TempItem)
|
||||
Total += TempItem->Weight;
|
||||
}
|
||||
for (x = 251; x < 331; x++)
|
||||
for (x = EmuConstants::GENERAL_BAGS_BEGIN; x <= EmuConstants::GENERAL_BAGS_END; x++) // include cursor bags or not?
|
||||
{
|
||||
int TmpWeight = 0;
|
||||
TempItem = 0;
|
||||
@@ -1147,9 +1147,11 @@ uint32 Client::CalcCurrentWeight() {
|
||||
TmpWeight = TempItem->Weight;
|
||||
if (TmpWeight > 0)
|
||||
{
|
||||
int bagslot = 22;
|
||||
// this code indicates that weight redux bags canonly be in the first general inventory slot to be effective...
|
||||
// is this correct? or can we scan for the highest weight redux and use that? (need client verifications)
|
||||
int bagslot = MainGeneral1;
|
||||
int reduction = 0;
|
||||
for (int m = 261; m < 331; m += 10)
|
||||
for (int m = MainGeneral2; m <= EmuConstants::GENERAL_BAGS_END; m += 10) // include cursor bags or not?
|
||||
{
|
||||
if (x >= m)
|
||||
bagslot += 1;
|
||||
@@ -1172,10 +1174,9 @@ uint32 Client::CalcCurrentWeight() {
|
||||
This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd.
|
||||
*/
|
||||
|
||||
// SoD client has no weight for coin
|
||||
if (GetClientVersion() < EQClientSoD) {
|
||||
// SoD+ client has no weight for coin
|
||||
if (EQLimits::CoinHasWeight(ClientVersion))
|
||||
Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4;
|
||||
}
|
||||
|
||||
float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat + (float)itembonuses.Packrat;
|
||||
if (Packrat > 0)
|
||||
|
||||
+17
-11
@@ -386,6 +386,7 @@ void MapOpcodes() {
|
||||
ConnectedOpcodes[OP_MercenaryTimerRequest] = &Client::Handle_OP_MercenaryTimerRequest;
|
||||
ConnectedOpcodes[OP_OpenInventory] = &Client::Handle_OP_OpenInventory;
|
||||
ConnectedOpcodes[OP_OpenContainer] = &Client::Handle_OP_OpenContainer;
|
||||
ConnectedOpcodes[OP_ClientTimeStamp] = &Client::Handle_OP_ClientTimeStamp;
|
||||
}
|
||||
|
||||
void ClearMappedOpcode(EmuOpcode op) {
|
||||
@@ -1629,7 +1630,7 @@ void Client::Handle_OP_Shielding(const EQApplicationPacket *app)
|
||||
Shielding_Struct* shield = (Shielding_Struct*)app->pBuffer;
|
||||
shield_target = entity_list.GetMob(shield->target_id);
|
||||
bool ack = false;
|
||||
ItemInst* inst = GetInv().GetItem(14);
|
||||
ItemInst* inst = GetInv().GetItem(MainSecondary);
|
||||
if (!shield_target)
|
||||
return;
|
||||
if (inst)
|
||||
@@ -3259,7 +3260,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
MoveItem_Struct* mi = (MoveItem_Struct*)app->pBuffer;
|
||||
if(spellend_timer.Enabled() && casting_spell_id && !IsBardSong(casting_spell_id))
|
||||
{
|
||||
if(mi->from_slot != mi->to_slot && (mi->from_slot < 30 || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
|
||||
if(mi->from_slot != mi->to_slot && (mi->from_slot <= EmuConstants::GENERAL_END || mi->from_slot > 39) && IsValidSlot(mi->from_slot) && IsValidSlot(mi->to_slot))
|
||||
{
|
||||
char *detect = nullptr;
|
||||
const ItemInst *itm_from = GetInv().GetItem(mi->from_slot);
|
||||
@@ -3280,8 +3281,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
// Illegal bagslot useage checks. Currently, user only receives a message if this check is triggered.
|
||||
bool mi_hack = false;
|
||||
|
||||
if(mi->from_slot >= 251 && mi->from_slot <= 340) {
|
||||
if(mi->from_slot > 330) { mi_hack = true; }
|
||||
if(mi->from_slot >= EmuConstants::GENERAL_BAGS_BEGIN && mi->from_slot <= EmuConstants::CURSOR_BAG_END) {
|
||||
if(mi->from_slot >= EmuConstants::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
else {
|
||||
int16 from_parent = m_inv.CalcSlotId(mi->from_slot);
|
||||
if(!m_inv[from_parent]) { mi_hack = true; }
|
||||
@@ -3290,8 +3291,8 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app)
|
||||
}
|
||||
}
|
||||
|
||||
if(mi->to_slot >= 251 && mi->to_slot <= 340) {
|
||||
if(mi->to_slot > 330) { mi_hack = true; }
|
||||
if(mi->to_slot >= EmuConstants::GENERAL_BAGS_BEGIN && mi->to_slot <= EmuConstants::CURSOR_BAG_END) {
|
||||
if(mi->to_slot >= EmuConstants::CURSOR_BAG_BEGIN) { mi_hack = true; }
|
||||
else {
|
||||
int16 to_parent = m_inv.CalcSlotId(mi->to_slot);
|
||||
if(!m_inv[to_parent]) { mi_hack = true; }
|
||||
@@ -6782,7 +6783,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) {
|
||||
|
||||
for (int16 L = 0; L <= 20; L++) {
|
||||
const ItemInst* inst = GetInv().GetItem(L);
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[L], item->Name);
|
||||
@@ -6791,14 +6792,15 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) {
|
||||
else { insr->itemicons[L] = 0xFFFFFFFF; }
|
||||
}
|
||||
|
||||
const ItemInst* inst = GetInv().GetItem(21);
|
||||
const ItemInst* inst = GetInv().GetItem(MainAmmo);
|
||||
item = inst ? inst->GetItem() : nullptr;
|
||||
|
||||
if(item) {
|
||||
strcpy(insr->itemnames[22], item->Name);
|
||||
insr->itemicons[22] = item->Icon;
|
||||
// another one..I did these, didn't I!!?
|
||||
strcpy(insr->itemnames[SoF::slots::MainAmmo], item->Name);
|
||||
insr->itemicons[SoF::slots::MainAmmo] = item->Icon;
|
||||
}
|
||||
else { insr->itemicons[22] = 0xFFFFFFFF; }
|
||||
else { insr->itemicons[SoF::slots::MainAmmo] = 0xFFFFFFFF; }
|
||||
|
||||
InspectMessage_Struct* newmessage = (InspectMessage_Struct*) insr->text;
|
||||
InspectMessage_Struct& playermessage = this->GetInspectMessage();
|
||||
@@ -13866,3 +13868,7 @@ void Client::Handle_OP_OpenContainer(const EQApplicationPacket *app) {
|
||||
// SideNote: Watching the slot translations, Unknown1 is showing '141' as well on certain item swaps.
|
||||
// Manually looting a corpse results in a from '34' to '68' value for equipment items, '0' to '0' for inventory.
|
||||
}
|
||||
|
||||
void Client::Handle_OP_ClientTimeStamp(const EQApplicationPacket *app) {
|
||||
// handle as needed or ignore like we have been doing...
|
||||
}
|
||||
|
||||
@@ -288,3 +288,4 @@
|
||||
void Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app);
|
||||
void Handle_OP_OpenInventory(const EQApplicationPacket *app);
|
||||
void Handle_OP_OpenContainer(const EQApplicationPacket *app);
|
||||
void Handle_OP_ClientTimeStamp(const EQApplicationPacket *app);
|
||||
|
||||
+15
-15
@@ -402,10 +402,10 @@ bool Client::Process() {
|
||||
{
|
||||
entity_list.AEAttack(this, 30);
|
||||
} else {
|
||||
Attack(auto_attack_target, 13); // Kaiyodo - added attacking hand to arguments
|
||||
Attack(auto_attack_target, MainPrimary); // Kaiyodo - added attacking hand to arguments
|
||||
}
|
||||
ItemInst *wpn = GetInv().GetItem(MainPrimary);
|
||||
TryWeaponProc(wpn, auto_attack_target, 13);
|
||||
TryWeaponProc(wpn, auto_attack_target, MainPrimary);
|
||||
|
||||
bool tripleAttackSuccess = false;
|
||||
if( auto_attack_target && CanThisClassDoubleAttack() ) {
|
||||
@@ -416,7 +416,7 @@ bool Client::Process() {
|
||||
if(CheckAAEffect(aaEffectRampage)) {
|
||||
entity_list.AEAttack(this, 30);
|
||||
} else {
|
||||
Attack(auto_attack_target, 13, false);
|
||||
Attack(auto_attack_target, MainPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,13 +426,13 @@ bool Client::Process() {
|
||||
&& CheckDoubleAttack(true))
|
||||
{
|
||||
tripleAttackSuccess = true;
|
||||
Attack(auto_attack_target, 13, false);
|
||||
Attack(auto_attack_target, MainPrimary, false);
|
||||
}
|
||||
|
||||
//quad attack, does this belong here??
|
||||
if(GetSpecialAbility(SPECATK_QUAD) && CheckDoubleAttack(true))
|
||||
{
|
||||
Attack(auto_attack_target, 13, false);
|
||||
Attack(auto_attack_target, MainPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,8 +444,8 @@ bool Client::Process() {
|
||||
if(MakeRandomInt(0, 99) < flurrychance)
|
||||
{
|
||||
Message_StringID(MT_NPCFlurry, YOU_FLURRY);
|
||||
Attack(auto_attack_target, 13, false);
|
||||
Attack(auto_attack_target, 13, false);
|
||||
Attack(auto_attack_target, MainPrimary, false);
|
||||
Attack(auto_attack_target, MainPrimary, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ bool Client::Process() {
|
||||
{
|
||||
if(MakeRandomInt(0, 99) < ExtraAttackChanceBonus)
|
||||
{
|
||||
Attack(auto_attack_target, 13, false);
|
||||
Attack(auto_attack_target, MainPrimary, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -507,19 +507,19 @@ bool Client::Process() {
|
||||
CheckIncreaseSkill(SkillDualWield, auto_attack_target, -10);
|
||||
if (random < DualWieldProbability){ // Max 78% of DW
|
||||
if(CheckAAEffect(aaEffectRampage)) {
|
||||
entity_list.AEAttack(this, 30, 14);
|
||||
entity_list.AEAttack(this, 30, MainSecondary);
|
||||
} else {
|
||||
Attack(auto_attack_target, 14); // Single attack with offhand
|
||||
Attack(auto_attack_target, MainSecondary); // Single attack with offhand
|
||||
}
|
||||
ItemInst *wpn = GetInv().GetItem(MainSecondary);
|
||||
TryWeaponProc(wpn, auto_attack_target, 14);
|
||||
TryWeaponProc(wpn, auto_attack_target, MainSecondary);
|
||||
|
||||
if( CanThisClassDoubleAttack() && CheckDoubleAttack()) {
|
||||
if(CheckAAEffect(aaEffectRampage)) {
|
||||
entity_list.AEAttack(this, 30, 14);
|
||||
entity_list.AEAttack(this, 30, MainSecondary);
|
||||
} else {
|
||||
if(auto_attack_target && auto_attack_target->GetHP() > -10)
|
||||
Attack(auto_attack_target, 14); // Single attack with offhand
|
||||
Attack(auto_attack_target, MainSecondary); // Single attack with offhand
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -878,9 +878,9 @@ void Client::BulkSendInventoryItems() {
|
||||
|
||||
// Power Source
|
||||
if(GetClientVersion() >= EQClientSoF) {
|
||||
const ItemInst* inst = m_inv[9999];
|
||||
const ItemInst* inst = m_inv[MainPowerSource];
|
||||
if(inst) {
|
||||
std::string packet = inst->Serialize(9999);
|
||||
std::string packet = inst->Serialize(MainPowerSource);
|
||||
ser_items[i++] = packet;
|
||||
size += packet.length();
|
||||
}
|
||||
|
||||
+3
-3
@@ -2957,9 +2957,9 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
}
|
||||
if(c->GetClientVersion() >= EQClientSoF)
|
||||
{
|
||||
const ItemInst* inst = client->GetInv().GetItem(9999);
|
||||
const ItemInst* inst = client->GetInv().GetItem(MainPowerSource);
|
||||
item = (inst) ? inst->GetItem() : nullptr;
|
||||
c->Message((item==0), "InvSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", 9999,
|
||||
c->Message((item==0), "InvSlot: %i, Item: %i (%c%06X00000000000000000000000000000000000000000000%s%c), Charges: %i", MainPowerSource,
|
||||
((item==0)?0:item->ID),0x12, ((item==0)?0:item->ID),
|
||||
((item==0)?"null":item->Name), 0x12,
|
||||
((item==0)?0:inst->GetCharges()));
|
||||
@@ -3034,7 +3034,7 @@ void command_peekinv(Client *c, const Seperator *sep)
|
||||
if (bAll || (strcasecmp(sep->arg[1], "trib")==0)) {
|
||||
// Active tribute effect items
|
||||
bFound = true;
|
||||
for (int16 i=TRIBUTE_SLOT_START; i<(TRIBUTE_SLOT_START + MAX_PLAYER_TRIBUTES); i++) {
|
||||
for (int16 i = EmuConstants::TRIBUTE_BEGIN; i <= EmuConstants::TRIBUTE_END; i++) {
|
||||
const ItemInst* inst = client->GetInv().GetItem(i);
|
||||
item = (inst) ? inst->GetItem() : nullptr;
|
||||
if (c->GetClientVersion() >= EQClientSoF)
|
||||
|
||||
+5
-13
@@ -367,9 +367,9 @@ Corpse::Corpse(Client* client, int32 in_rezexp)
|
||||
for(i = 0; i <= 30; i++)
|
||||
{
|
||||
if(i == 21 && client->GetClientVersion() >= EQClientSoF) {
|
||||
item = client->GetInv().GetItem(9999);
|
||||
item = client->GetInv().GetItem(MainPowerSource);
|
||||
if((item && (!client->IsBecomeNPC())) || (item && client->IsBecomeNPC() && !item->GetItem()->NoRent)) {
|
||||
std::list<uint32> slot_list = MoveItemToCorpse(client, item, 9999);
|
||||
std::list<uint32> slot_list = MoveItemToCorpse(client, item, MainPowerSource);
|
||||
removed_list.merge(slot_list);
|
||||
}
|
||||
|
||||
@@ -999,12 +999,8 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
|
||||
end = itemlist.end();
|
||||
|
||||
uint8 containercount = 0;
|
||||
int corpselootlimit;
|
||||
|
||||
if(client->GetClientVersion() >= EQClientRoF) { corpselootlimit = 34; }
|
||||
else if(client->GetClientVersion() >= EQClientSoF) { corpselootlimit = 32; }
|
||||
else if(client->GetClientVersion() == EQClientTitanium) { corpselootlimit = 31; }
|
||||
else { corpselootlimit = 30; }
|
||||
int corpselootlimit = EQLimits::InventoryMapSize(MapCorpse, client->GetClientVersion());
|
||||
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* item_data = *cur;
|
||||
@@ -1331,17 +1327,13 @@ void Corpse::QueryLoot(Client* to) {
|
||||
cur = itemlist.begin();
|
||||
end = itemlist.end();
|
||||
|
||||
int corpselootlimit;
|
||||
|
||||
if (to->GetClientVersion() >= EQClientSoF) { corpselootlimit = 32; }
|
||||
else if (to->GetClientVersion() == EQClientTitanium) { corpselootlimit = 31; }
|
||||
else { corpselootlimit = 30; }
|
||||
int corpselootlimit = EQLimits::InventoryMapSize(MapCorpse, to->GetClientVersion());
|
||||
|
||||
for(; cur != end; ++cur) {
|
||||
ServerLootItem_Struct* sitem = *cur;
|
||||
|
||||
if (IsPlayerCorpse()) {
|
||||
if (sitem->equipSlot >= 251 && sitem->equipSlot <= 340)
|
||||
if (sitem->equipSlot >= EmuConstants::GENERAL_BAGS_BEGIN && sitem->equipSlot <= EmuConstants::CURSOR_BAG_END)
|
||||
sitem->lootslot = 0xFFFF;
|
||||
else
|
||||
x < corpselootlimit ? sitem->lootslot = x : sitem->lootslot = 0xFFFF;
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) { return true; }
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false) { return; }
|
||||
virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false,
|
||||
virtual bool Attack(Mob* other, int Hand = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = true, bool IsFromSpell = false,
|
||||
ExtraAttackOptions *opts = nullptr) { return false; }
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
|
||||
+1
-1
@@ -305,7 +305,7 @@ public:
|
||||
void QueueToGroupsForNPCHealthAA(Mob* sender, const EQApplicationPacket* app);
|
||||
void QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender=false, bool ackreq = true);
|
||||
|
||||
void AEAttack(Mob *attacker, float dist, int Hand = 13, int count = 0, bool IsFromSpell = false);
|
||||
void AEAttack(Mob *attacker, float dist, int Hand = MainPrimary, int count = 0, bool IsFromSpell = false);
|
||||
void AETaunt(Client *caster, float range = 0);
|
||||
void AESpell(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true, int16 resist_adjust = 0);
|
||||
void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true);
|
||||
|
||||
+2
-2
@@ -301,7 +301,7 @@ void Client::GoFish()
|
||||
Bait = m_inv.GetItem(bslot);
|
||||
|
||||
//if the bait isnt equipped, need to add its skill bonus
|
||||
if(bslot >= IDX_INV && Bait->GetItem()->SkillModType == SkillFishing) {
|
||||
if(bslot >= EmuConstants::GENERAL_BEGIN && Bait->GetItem()->SkillModType == SkillFishing) {
|
||||
fishing_skill += Bait->GetItem()->SkillModValue;
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ void Client::GoFish()
|
||||
//and then swap out items in primary slot... too lazy to fix right now
|
||||
if (MakeRandomInt(0, 49) == 1) {
|
||||
Message_StringID(MT_Skills, FISHING_POLE_BROKE); //Your fishing pole broke!
|
||||
DeleteItemInInventory(13,0,true);
|
||||
DeleteItemInInventory(MainPrimary, 0, true);
|
||||
}
|
||||
|
||||
if(CheckIncreaseSkill(SkillFishing, nullptr, 5))
|
||||
|
||||
+1
-1
@@ -545,7 +545,7 @@ int HateList::AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOption
|
||||
if(cur)
|
||||
{
|
||||
for(int i = 0; i < count; ++i) {
|
||||
caster->Attack(cur, 13, false, false, false, opts);
|
||||
caster->Attack(cur, MainPrimary, false, false, false, opts);
|
||||
}
|
||||
}
|
||||
iter++;
|
||||
|
||||
+50
-51
@@ -44,7 +44,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
|
||||
int i;
|
||||
if(where_to_check & invWhereWorn) {
|
||||
for (i=0; i<=21; i++) { // Equipped
|
||||
for (i = EmuConstants::EQUIPMENT_BEGIN; i <= EmuConstants::EQUIPMENT_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -57,9 +57,8 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
}
|
||||
|
||||
// Power Source Slot
|
||||
if (GetItemIDAt(9999) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(9999) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(9999);
|
||||
if (GetItemIDAt(MainPowerSource) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(MainPowerSource) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(MainPowerSource);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
x += cur->GetCharges();
|
||||
} else {
|
||||
@@ -67,25 +66,25 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
|
||||
if (GetClientVersion() >= EQClientSoF)
|
||||
DeleteItemInInventory(9999, 0, true);
|
||||
DeleteItemInInventory(MainPowerSource, 0, true);
|
||||
else
|
||||
DeleteItemInInventory(9999, 0, false); // Prevents Titanium crash
|
||||
DeleteItemInInventory(MainPowerSource, 0, false); // Prevents Titanium crash
|
||||
}
|
||||
}
|
||||
|
||||
if(where_to_check & invWhereCursor) {
|
||||
if (GetItemIDAt(30) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(30) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(30);
|
||||
if (GetItemIDAt(MainCursor) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(MainCursor) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(MainCursor);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
x += cur->GetCharges();
|
||||
} else {
|
||||
x++;
|
||||
}
|
||||
|
||||
DeleteItemInInventory(30, 0, true);
|
||||
DeleteItemInInventory(MainCursor, 0, true);
|
||||
}
|
||||
|
||||
for (i=331; i<=340; i++) { // cursor's containers
|
||||
for (i = EmuConstants::CURSOR_BAG_BEGIN; i <= EmuConstants::CURSOR_BAG_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -100,7 +99,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
|
||||
if(where_to_check & invWherePersonal) {
|
||||
for (i=22; i<=29; i++) { // Equipped
|
||||
for (i = EmuConstants::GENERAL_BEGIN; i <= EmuConstants::GENERAL_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -113,7 +112,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i=251; i<=330; i++) { // Main inventory's containers
|
||||
for (i = EmuConstants::GENERAL_BAGS_BEGIN; i <= EmuConstants::GENERAL_BAGS_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -128,7 +127,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
|
||||
if(where_to_check & invWhereBank) {
|
||||
for (i=2000; i<=2023; i++) { // Bank slots
|
||||
for (i = EmuConstants::BANK_BEGIN; i <= EmuConstants::BANK_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -141,7 +140,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i=2031; i<=2270; i++) { // Bank's containers
|
||||
for (i = EmuConstants::BANK_BAGS_BEGIN; i <= EmuConstants::BANK_BAGS_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -156,7 +155,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
|
||||
if(where_to_check & invWhereSharedBank) {
|
||||
for (i=2500; i<=2501; i++) { // Shared bank
|
||||
for (i = EmuConstants::SHARED_BANK_BEGIN; i <= EmuConstants::SHARED_BANK_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -169,7 +168,7 @@ uint32 Client::NukeItem(uint32 itemnum, uint8 where_to_check) {
|
||||
}
|
||||
}
|
||||
|
||||
for (i=2531; i<=2550; i++) { // Shared bank's containers
|
||||
for (i = EmuConstants::SHARED_BANK_BAGS_BEGIN; i <= EmuConstants::SHARED_BANK_BAGS_END; i++) {
|
||||
if (GetItemIDAt(i) == itemnum || (itemnum == 0xFFFE && GetItemIDAt(i) != INVALID_ID)) {
|
||||
cur = m_inv.GetItem(i);
|
||||
if(cur && cur->GetItem()->Stackable) {
|
||||
@@ -1225,17 +1224,17 @@ void Client::SendLootItemInPacket(const ItemInst* inst, int16 slot_id)
|
||||
}
|
||||
|
||||
bool Client::IsValidSlot(uint32 slot) {
|
||||
if ((slot == (uint32)INVALID_INDEX) || // Destroying/Dropping item
|
||||
(slot >= MainCharm && slot <= MainCursor) || // Worn inventory, normal inventory, and cursor
|
||||
(slot >= 251 && slot <= 340) || // Normal inventory bags and cursor bag
|
||||
(slot >= 400 && slot <= 404) || // Tribute
|
||||
(slot >= 2000 && slot <= 2023) || // Bank
|
||||
(slot >= 2031 && slot <= 2270) || // Bank bags
|
||||
(slot >= 2500 && slot <= 2501) || // Shared bank
|
||||
(slot >= 2531 && slot <= 2550) || // Shared bank bags
|
||||
(slot >= 3000 && slot <= 3007) || // Trade window
|
||||
(slot >= 4000 && slot <= 4009) || // Tradeskill container
|
||||
(slot == MainPowerSource)) // Power Source
|
||||
if ((slot == (uint32)INVALID_INDEX) ||
|
||||
(slot >= EmuConstants::POSSESSIONS_BEGIN && slot <= EmuConstants::POSSESSIONS_END) ||
|
||||
(slot >= EmuConstants::GENERAL_BAGS_BEGIN && slot <= EmuConstants::CURSOR_BAG_END) ||
|
||||
(slot >= EmuConstants::TRIBUTE_BEGIN && slot <= EmuConstants::TRIBUTE_END) ||
|
||||
(slot >= EmuConstants::BANK_BEGIN && slot <= EmuConstants::BANK_END) ||
|
||||
(slot >= EmuConstants::BANK_BAGS_BEGIN && slot <= EmuConstants::BANK_BAGS_END) ||
|
||||
(slot >= EmuConstants::SHARED_BANK_BEGIN && slot <= EmuConstants::SHARED_BANK_END) ||
|
||||
(slot >= EmuConstants::SHARED_BANK_BAGS_BEGIN && slot <= EmuConstants::SHARED_BANK_BAGS_END) ||
|
||||
(slot >= EmuConstants::TRADE_BEGIN && slot <= EmuConstants::TRADE_END) ||
|
||||
(slot >= EmuConstants::WORLD_BEGIN && slot <= EmuConstants::WORLD_END) ||
|
||||
(slot == EmuConstants::POWER_SOURCE))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
@@ -1945,10 +1944,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
|
||||
ItemInst* ins;
|
||||
int x;
|
||||
int num = 0;
|
||||
for(x=0; x < 331; x++)
|
||||
for(x = EmuConstants::POSSESSIONS_BEGIN; x <= EmuConstants::GENERAL_BAGS_END; x++)
|
||||
{
|
||||
if (x == 31)
|
||||
x = 251;
|
||||
if (x == EmuConstants::CURSOR + 1)
|
||||
x = EmuConstants::GENERAL_BAGS_BEGIN;
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
if (ins)
|
||||
@@ -1962,10 +1961,10 @@ bool Client::DecreaseByID(uint32 type, uint8 amt) {
|
||||
}
|
||||
if (num < amt)
|
||||
return false;
|
||||
for(x=0; x < 331; x++)
|
||||
for(x = EmuConstants::POSSESSIONS_BEGIN; x <= EmuConstants::GENERAL_BAGS_END; x++) // should this be CURSOR_BAG_END
|
||||
{
|
||||
if (x == 31)
|
||||
x = 251;
|
||||
if (x == EmuConstants::CURSOR + 1)
|
||||
x = EmuConstants::GENERAL_BAGS_BEGIN;
|
||||
TempItem = 0;
|
||||
ins = GetInv().GetItem(x);
|
||||
if (ins)
|
||||
@@ -1994,7 +1993,7 @@ void Client::RemoveNoRent(bool client_update) {
|
||||
int16 slot_id;
|
||||
|
||||
// personal
|
||||
for(slot_id = 0; slot_id <= 30; slot_id++) {
|
||||
for(slot_id = EmuConstants::POSSESSIONS_BEGIN; slot_id <= EmuConstants::POSSESSIONS_END; slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2003,14 +2002,14 @@ void Client::RemoveNoRent(bool client_update) {
|
||||
}
|
||||
|
||||
// power source
|
||||
const ItemInst* inst = m_inv[9999];
|
||||
const ItemInst* inst = m_inv[EmuConstants::POWER_SOURCE];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent
|
||||
mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, EmuConstants::POWER_SOURCE);
|
||||
DeleteItemInInventory(EmuConstants::POWER_SOURCE, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent
|
||||
}
|
||||
|
||||
// containers
|
||||
for(slot_id = 251; slot_id <= 340; slot_id++) {
|
||||
for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2019,7 +2018,7 @@ void Client::RemoveNoRent(bool client_update) {
|
||||
}
|
||||
|
||||
// bank
|
||||
for(slot_id = 2000; slot_id <= 2023; slot_id++) {
|
||||
for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2028,7 +2027,7 @@ void Client::RemoveNoRent(bool client_update) {
|
||||
}
|
||||
|
||||
// bank containers
|
||||
for(slot_id = 2031; slot_id <= 2270; slot_id++) {
|
||||
for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2037,7 +2036,7 @@ void Client::RemoveNoRent(bool client_update) {
|
||||
}
|
||||
|
||||
// shared bank
|
||||
for(slot_id = 2500; slot_id <= 2501; slot_id++) {
|
||||
for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2046,7 +2045,7 @@ void Client::RemoveNoRent(bool client_update) {
|
||||
}
|
||||
|
||||
// shared bank containers
|
||||
for(slot_id = 2531; slot_id <= 2550; slot_id++) {
|
||||
for(slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; slot_id++) {
|
||||
const ItemInst* inst = m_inv[slot_id];
|
||||
if(inst && !inst->GetItem()->NoRent) {
|
||||
mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
@@ -2061,7 +2060,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
||||
int16 slot_id;
|
||||
|
||||
// personal
|
||||
for(slot_id = 0; slot_id <= 30; slot_id++) {
|
||||
for(slot_id = EmuConstants::POSSESSIONS_BEGIN; slot_id <= EmuConstants::POSSESSIONS_END; slot_id++) {
|
||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||
if(inst) {
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2076,20 +2075,20 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
||||
}
|
||||
|
||||
// power source
|
||||
ItemInst* inst = m_inv.PopItem(9999);
|
||||
ItemInst* inst = m_inv.PopItem(EmuConstants::POWER_SOURCE);
|
||||
if(inst) {
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id);
|
||||
database.SaveInventory(character_id, nullptr, 9999);
|
||||
database.SaveInventory(character_id, nullptr, EmuConstants::POWER_SOURCE);
|
||||
}
|
||||
else {
|
||||
m_inv.PutItem(9999, *inst);
|
||||
m_inv.PutItem(EmuConstants::POWER_SOURCE, *inst);
|
||||
}
|
||||
safe_delete(inst);
|
||||
}
|
||||
|
||||
// containers
|
||||
for(slot_id = 251; slot_id <= 340; slot_id++) {
|
||||
for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) {
|
||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||
if(inst) {
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2104,7 +2103,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
||||
}
|
||||
|
||||
// bank
|
||||
for(slot_id = 2000; slot_id <= 2023; slot_id++) {
|
||||
for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) {
|
||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||
if(inst) {
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2119,7 +2118,7 @@ void Client::RemoveDuplicateLore(bool client_update) {
|
||||
}
|
||||
|
||||
// bank containers
|
||||
for(slot_id = 2031; slot_id <= 2270; slot_id++) {
|
||||
for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) {
|
||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||
if(inst) {
|
||||
if(CheckLoreConflict(inst->GetItem())) {
|
||||
@@ -2141,7 +2140,7 @@ void Client::MoveSlotNotAllowed(bool client_update) {
|
||||
int16 slot_id;
|
||||
|
||||
// equipment
|
||||
for(slot_id = 0; slot_id <= 21; slot_id++) {
|
||||
for(slot_id = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; slot_id++) {
|
||||
if(m_inv[slot_id] && !m_inv[slot_id]->IsSlotAllowed(slot_id)) {
|
||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
||||
@@ -2154,7 +2153,7 @@ void Client::MoveSlotNotAllowed(bool client_update) {
|
||||
}
|
||||
|
||||
// power source
|
||||
slot_id = 9999;
|
||||
slot_id = EmuConstants::POWER_SOURCE;
|
||||
if(m_inv[slot_id] && !m_inv[slot_id]->IsSlotAllowed(slot_id)) {
|
||||
ItemInst* inst = m_inv.PopItem(slot_id);
|
||||
bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false;
|
||||
|
||||
@@ -1453,13 +1453,13 @@ luabind::scope lua_register_slot() {
|
||||
luabind::value("General8", static_cast<int>(MainGeneral8)),
|
||||
//luabind::value("General9", static_cast<int>(MainGeneral9)),
|
||||
//luabind::value("General10", static_cast<int>(MainGeneral10)),
|
||||
luabind::value("Cursor", static_cast<int>(MainCursor)),
|
||||
//luabind::value("EquipmentBegin", static_cast<int>(EmuConstants::EQUIPMENT_BEGIN)),
|
||||
//luabind::value("EquipmentEnd", static_cast<int>(EmuConstants::EQUIPMENT_END)),
|
||||
luabind::value("PersonalBegin", static_cast<int>(EmuConstants::GENERAL_BEGIN)), // deprecated
|
||||
luabind::value("GeneralBegin", static_cast<int>(EmuConstants::GENERAL_BEGIN)),
|
||||
luabind::value("PersonalEnd", static_cast<int>(EmuConstants::GENERAL_END)), // deprecated
|
||||
luabind::value("GeneralEnd", static_cast<int>(EmuConstants::GENERAL_END)),
|
||||
luabind::value("Cursor", static_cast<int>(MainCursor)),
|
||||
luabind::value("CursorEnd", 0xFFFE), // deprecated
|
||||
luabind::value("Tradeskill", static_cast<int>(SLOT_TRADESKILL)), // deprecated
|
||||
luabind::value("Augment", static_cast<int>(SLOT_AUGMENT)), // deprecated
|
||||
@@ -1483,6 +1483,7 @@ luabind::scope lua_register_material() {
|
||||
luabind::value("Secondary", static_cast<int>(MaterialSecondary)),
|
||||
luabind::value("Max", static_cast<int>(_MaterialCount)), // deprecated
|
||||
luabind::value("Count", static_cast<int>(_MaterialCount)),
|
||||
//luabind::value("TintCount", static_cast<int>(_MaterialCount - 2)),
|
||||
luabind::value("Invalid", static_cast<int>(_MaterialInvalid))
|
||||
];
|
||||
}
|
||||
@@ -1497,7 +1498,8 @@ luabind::scope lua_register_client_version() {
|
||||
luabind::value("SoF", static_cast<int>(EQClientSoF)),
|
||||
luabind::value("SoD", static_cast<int>(EQClientSoD)),
|
||||
luabind::value("Underfoot", static_cast<int>(EQClientUnderfoot)),
|
||||
luabind::value("RoF", static_cast<int>(EQClientRoF))
|
||||
luabind::value("RoF", static_cast<int>(EQClientRoF))//,
|
||||
//luabind::value("RoF2", static_cast<int>(EQClientRoF2))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -277,7 +277,7 @@ void Merc::CalcItemBonuses(StatBonuses* newbon) {
|
||||
//Power Source Slot
|
||||
/*if (GetClientVersion() >= EQClientSoF)
|
||||
{
|
||||
const ItemInst* inst = m_inv[9999];
|
||||
const ItemInst* inst = m_inv[MainPowerSource];
|
||||
if(inst)
|
||||
AddItemBonuses(inst, newbon);
|
||||
}*/
|
||||
|
||||
+10
-10
@@ -131,11 +131,11 @@ public:
|
||||
virtual void ThrowingAttack(Mob* other) { }
|
||||
uint16 GetThrownDamage(int16 wDmg, int32& TotalDmg, int& minDmg);
|
||||
// 13 = Primary (default), 14 = secondary
|
||||
virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
virtual bool Attack(Mob* other, int Hand = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr) = 0;
|
||||
int MonkSpecialAttack(Mob* other, uint8 skill_used);
|
||||
virtual void TryBackstab(Mob *other,int ReuseTime = 10);
|
||||
void TriggerDefensiveProcs(const ItemInst* weapon, Mob *on, uint16 hand = 13, int damage = 0);
|
||||
void TriggerDefensiveProcs(const ItemInst* weapon, Mob *on, uint16 hand = MainPrimary, int damage = 0);
|
||||
virtual bool AvoidDamage(Mob* attacker, int32 &damage, bool CanRiposte = true);
|
||||
virtual bool CheckHitChance(Mob* attacker, SkillUseTypes skillinuse, int Hand, int16 chance_mod = 0);
|
||||
virtual void TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttackOptions *opts = nullptr);
|
||||
@@ -990,19 +990,19 @@ protected:
|
||||
bool focused;
|
||||
void CalcSpellBonuses(StatBonuses* newbon);
|
||||
virtual void CalcBonuses();
|
||||
void TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success = false, uint16 hand = 0, bool IsDefensive = false);
|
||||
void TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success = false, uint16 hand = 0, bool IsDefensive = false); // hand = MainCharm?
|
||||
bool PassLimitToSkill(uint16 spell_id, uint16 skill);
|
||||
bool PassLimitClass(uint32 Classes_, uint16 Class_);
|
||||
void TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand = 13);
|
||||
void TryWeaponProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = 13);
|
||||
void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = 13);
|
||||
void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = 13);
|
||||
void TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand = MainPrimary);
|
||||
void TryWeaponProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = MainPrimary);
|
||||
void TrySpellProc(const ItemInst* inst, const Item_Struct* weapon, Mob *on, uint16 hand = MainPrimary);
|
||||
void TryWeaponProc(const ItemInst* weapon, Mob *on, uint16 hand = MainPrimary);
|
||||
void ExecWeaponProc(const ItemInst* weapon, uint16 spell_id, Mob *on);
|
||||
virtual float GetProcChances(float ProcBonus, uint16 hand = 13);
|
||||
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = 13, Mob *on = nullptr);
|
||||
virtual float GetProcChances(float ProcBonus, uint16 hand = MainPrimary);
|
||||
virtual float GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 hand = MainPrimary, Mob *on = nullptr);
|
||||
virtual float GetSpecialProcChances(uint16 hand);
|
||||
virtual float GetAssassinateProcChances(uint16 ReuseTime);
|
||||
virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0);
|
||||
virtual float GetSkillProcChances(uint16 ReuseTime, uint16 hand = 0); // hand = MainCharm?
|
||||
uint16 GetWeaponSpeedbyHand(uint16 hand);
|
||||
int GetWeaponDamage(Mob *against, const Item_Struct *weapon_item);
|
||||
int GetWeaponDamage(Mob *against, const ItemInst *weapon_item, uint32 *hate = nullptr);
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ public:
|
||||
//abstract virtual function implementations requird by base abstract class
|
||||
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill);
|
||||
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false);
|
||||
virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
virtual bool Attack(Mob* other, int Hand = MainPrimary, bool FromRiposte = false, bool IsStrikethrough = false,
|
||||
bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr);
|
||||
virtual bool HasRaid() { return false; }
|
||||
virtual bool HasGroup() { return false; }
|
||||
|
||||
+1
-1
@@ -872,7 +872,7 @@ XS(XS_Mob_Attack)
|
||||
Perl_croak(aTHX_ "other is nullptr, avoiding crash.");
|
||||
|
||||
if (items < 3)
|
||||
Hand = 13;
|
||||
Hand = MainPrimary;
|
||||
else {
|
||||
Hand = (int)SvIV(ST(2));
|
||||
}
|
||||
|
||||
+2
-2
@@ -2429,12 +2429,12 @@ int QuestManager::collectitems(uint32 item_id, bool remove)
|
||||
int quantity = 0;
|
||||
int slot_id;
|
||||
|
||||
for (slot_id = 22; slot_id <= 29; ++slot_id)
|
||||
for (slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; ++slot_id)
|
||||
{
|
||||
quantity += collectitems_processSlot(slot_id, item_id, remove);
|
||||
}
|
||||
|
||||
for (slot_id = 251; slot_id <= 330; ++slot_id)
|
||||
for (slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::GENERAL_BAGS_END; ++slot_id)
|
||||
{
|
||||
quantity += collectitems_processSlot(slot_id, item_id, remove);
|
||||
}
|
||||
|
||||
+18
-18
@@ -131,7 +131,7 @@ void Mob::DoSpecialAttackDamage(Mob *who, SkillUseTypes skill, int32 max_damage,
|
||||
|
||||
min_damage += min_damage * GetMeleeMinDamageMod_SE(skill) / 100;
|
||||
|
||||
if(HitChance && !who->CheckHitChance(this, skill, 13))
|
||||
if(HitChance && !who->CheckHitChance(this, skill, MainPrimary))
|
||||
max_damage = 0;
|
||||
|
||||
else{
|
||||
@@ -570,7 +570,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
|
||||
CastToClient()->CheckIncreaseSkill(SkillBackstab, other, 10);
|
||||
}
|
||||
else { //We do a single regular attack if we attack from the front without chaotic stab
|
||||
Attack(other, 13);
|
||||
Attack(other, MainPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -817,7 +817,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Item
|
||||
if (!CanDoSpecialAttack(other))
|
||||
return;
|
||||
|
||||
if (!other->CheckHitChance(this, SkillArchery, 13,chance_mod)) {
|
||||
if (!other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod)) {
|
||||
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
||||
other->Damage(this, 0, SPELL_UNKNOWN, SkillArchery);
|
||||
} else {
|
||||
@@ -939,27 +939,27 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Item
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, SkillArchery, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, SkillArchery, 0, true, 11);
|
||||
TrySkillProc(other, SkillArchery, 0, true, MainRange);
|
||||
}
|
||||
}
|
||||
|
||||
//try proc on hits and misses
|
||||
if((RangeWeapon != nullptr) && GetTarget() && other && !other->HasDied())
|
||||
{
|
||||
TryWeaponProc(RangeWeapon, other, 11);
|
||||
TryWeaponProc(RangeWeapon, other, MainRange);
|
||||
}
|
||||
|
||||
//Arrow procs because why not?
|
||||
if((Ammo != NULL) && GetTarget() && other && !other->HasDied())
|
||||
{
|
||||
TryWeaponProc(Ammo, other, 11);
|
||||
TryWeaponProc(Ammo, other, MainRange);
|
||||
}
|
||||
|
||||
if (HasSkillProcs() && GetTarget() && other && !other->HasDied()){
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, SkillArchery, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, SkillArchery, 0, false, 11);
|
||||
TrySkillProc(other, SkillArchery, 0, false, MainRange);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1028,7 +1028,7 @@ void NPC::RangedAttack(Mob* other)
|
||||
|
||||
FaceTarget(other);
|
||||
|
||||
if (!other->CheckHitChance(this, skillinuse, 11, GetSpecialAbilityParam(SPECATK_RANGED_ATK, 2)))
|
||||
if (!other->CheckHitChance(this, skillinuse, MainRange, GetSpecialAbilityParam(SPECATK_RANGED_ATK, 2)))
|
||||
{
|
||||
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
||||
other->Damage(this, 0, SPELL_UNKNOWN, skillinuse);
|
||||
@@ -1069,15 +1069,15 @@ void NPC::RangedAttack(Mob* other)
|
||||
other->Damage(this, TotalDmg, SPELL_UNKNOWN, skillinuse);
|
||||
|
||||
if (TotalDmg > 0 && HasSkillProcSuccess() && GetTarget() && !other->HasDied())
|
||||
TrySkillProc(other, skillinuse, 0, true, 11);
|
||||
TrySkillProc(other, skillinuse, 0, true, MainRange);
|
||||
}
|
||||
|
||||
//try proc on hits and misses
|
||||
if(other && !other->HasDied())
|
||||
TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, 11);
|
||||
TrySpellProc(nullptr, (const Item_Struct*)nullptr, other, MainRange);
|
||||
|
||||
if (HasSkillProcs() && other && !other->HasDied())
|
||||
TrySkillProc(other, skillinuse, 0, false, 11);
|
||||
TrySkillProc(other, skillinuse, 0, false, MainRange);
|
||||
|
||||
CommonBreakInvisible();
|
||||
}
|
||||
@@ -1200,7 +1200,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
||||
if (!CanDoSpecialAttack(other))
|
||||
return;
|
||||
|
||||
if (!other->CheckHitChance(this, SkillThrowing, 13, chance_mod)){
|
||||
if (!other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod)){
|
||||
mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName());
|
||||
other->Damage(this, 0, SPELL_UNKNOWN, SkillThrowing);
|
||||
} else {
|
||||
@@ -1251,18 +1251,18 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, SkillThrowing, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, SkillThrowing, 0, true, 11);
|
||||
TrySkillProc(other, SkillThrowing, 0, true, MainRange);
|
||||
}
|
||||
}
|
||||
|
||||
if((RangeWeapon != nullptr) && GetTarget() && other && (other->GetHP() > -10))
|
||||
TryWeaponProc(RangeWeapon, other, 11);
|
||||
TryWeaponProc(RangeWeapon, other, MainRange);
|
||||
|
||||
if (HasSkillProcs() && GetTarget() && other && !other->HasDied()){
|
||||
if (ReuseTime)
|
||||
TrySkillProc(other, SkillThrowing, ReuseTime);
|
||||
else
|
||||
TrySkillProc(other, SkillThrowing, 0, false, 11);
|
||||
TrySkillProc(other, SkillThrowing, 0, false, MainRange);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1987,7 +1987,7 @@ uint32 Mob::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) {
|
||||
|
||||
if(HeadShot_Dmg && HeadShot_Level && (defender->GetLevel() <= HeadShot_Level)){
|
||||
|
||||
float ProcChance = GetSpecialProcChances(11);
|
||||
float ProcChance = GetSpecialProcChances(MainRange);
|
||||
if(ProcChance > MakeRandomFloat(0,1))
|
||||
return HeadShot_Dmg;
|
||||
}
|
||||
@@ -2050,7 +2050,7 @@ uint32 Mob::TryAssassinate(Mob* defender, SkillUseTypes skillInUse, uint16 Reuse
|
||||
float ProcChance = 0.0f;
|
||||
|
||||
if (skillInUse == SkillThrowing)
|
||||
ProcChance = GetSpecialProcChances(11);
|
||||
ProcChance = GetSpecialProcChances(MainRange);
|
||||
else
|
||||
ProcChance = GetAssassinateProcChances(ReuseTime);
|
||||
|
||||
@@ -2099,7 +2099,7 @@ void Mob::DoMeleeSkillAttackDmg(Mob* other, uint16 weapon_damage, SkillUseTypes
|
||||
|
||||
int damage = 0;
|
||||
int32 hate = 0;
|
||||
int Hand = 13;
|
||||
int Hand = MainPrimary;
|
||||
if (hate == 0 && weapon_damage > 1) hate = weapon_damage;
|
||||
|
||||
if(weapon_damage > 0){
|
||||
|
||||
@@ -2200,7 +2200,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
|
||||
snprintf(effect_desc, _EDLEN, "Rampage");
|
||||
#endif
|
||||
if(caster)
|
||||
entity_list.AEAttack(caster, 30, 13, 0, true); // on live wars dont get a duration ramp, its a one shot deal
|
||||
entity_list.AEAttack(caster, 30, MainPrimary, 0, true); // on live wars dont get a duration ramp, its a one shot deal
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -5264,7 +5264,7 @@ int16 Client::GetFocusEffect(focusType type, uint16 spell_id) {
|
||||
}
|
||||
|
||||
//Tribute Focus
|
||||
for(int x = TRIBUTE_SLOT_START; x < (TRIBUTE_SLOT_START + MAX_PLAYER_TRIBUTES); ++x)
|
||||
for(int x = EmuConstants::TRIBUTE_BEGIN; x <= EmuConstants::TRIBUTE_END; ++x)
|
||||
{
|
||||
TempItem = nullptr;
|
||||
ItemInst* ins = GetInv().GetItem(x);
|
||||
|
||||
+2
-2
@@ -146,13 +146,13 @@ void Trade::SendItemData(const ItemInst* inst, int16 dest_slot_id)
|
||||
Client* with = mob->CastToClient();
|
||||
Client* trader = owner->CastToClient();
|
||||
if (with && with->IsClient()) {
|
||||
with->SendItemPacket(dest_slot_id -IDX_TRADE,inst,ItemPacketTradeView);
|
||||
with->SendItemPacket(dest_slot_id - EmuConstants::TRADE_BEGIN, inst, ItemPacketTradeView);
|
||||
if (inst->GetItem()->ItemClass == 1) {
|
||||
for (uint16 i=0; i<10; i++) {
|
||||
uint16 bagslot_id = Inventory::CalcSlotId(dest_slot_id, i);
|
||||
const ItemInst* bagitem = trader->GetInv().GetItem(bagslot_id);
|
||||
if (bagitem) {
|
||||
with->SendItemPacket(bagslot_id-IDX_TRADE,bagitem,ItemPacketTradeView);
|
||||
with->SendItemPacket(bagslot_id - EmuConstants::TRADE_BEGIN, bagitem, ItemPacketTradeView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -66,7 +66,7 @@ void Client::ToggleTribute(bool enabled) {
|
||||
int r;
|
||||
uint32 cost = 0;
|
||||
uint32 level = GetLevel();
|
||||
for(r = 0; r < MAX_PLAYER_TRIBUTES; r++) {
|
||||
for(r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) {
|
||||
uint32 tid = m_pp.tributes[r].tribute;
|
||||
if(tid == TRIBUTE_NONE)
|
||||
continue;
|
||||
@@ -119,7 +119,7 @@ void Client::DoTributeUpdate() {
|
||||
tis->tribute_master_id = tribute_master_id; //Dont know what this is for
|
||||
|
||||
int r;
|
||||
for(r = 0; r < MAX_PLAYER_TRIBUTES; r++) {
|
||||
for(r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) {
|
||||
if(m_pp.tributes[r].tribute != TRIBUTE_NONE) {
|
||||
tis->tributes[r] = m_pp.tributes[r].tribute;
|
||||
tis->tiers[r] = m_pp.tributes[r].tier;
|
||||
@@ -134,24 +134,24 @@ void Client::DoTributeUpdate() {
|
||||
|
||||
if(m_pp.tribute_active) {
|
||||
//send and equip tribute items...
|
||||
for(r = 0; r < MAX_PLAYER_TRIBUTES; r++) {
|
||||
for(r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) {
|
||||
uint32 tid = m_pp.tributes[r].tribute;
|
||||
if(tid == TRIBUTE_NONE) {
|
||||
if(m_inv[TRIBUTE_SLOT_START+r])
|
||||
DeleteItemInInventory(TRIBUTE_SLOT_START+r, 0, false);
|
||||
if(m_inv[EmuConstants::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, 0, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(tribute_list.count(tid) != 1) {
|
||||
if(m_inv[TRIBUTE_SLOT_START+r])
|
||||
DeleteItemInInventory(TRIBUTE_SLOT_START+r, 0, false);
|
||||
if (m_inv[EmuConstants::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, 0, false);
|
||||
continue;
|
||||
}
|
||||
|
||||
//sanity check
|
||||
if(m_pp.tributes[r].tier >= MAX_TRIBUTE_TIERS) {
|
||||
if(m_inv[TRIBUTE_SLOT_START+r])
|
||||
DeleteItemInInventory(TRIBUTE_SLOT_START+r, 0, false);
|
||||
if (m_inv[EmuConstants::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, 0, false);
|
||||
m_pp.tributes[r].tier = 0;
|
||||
continue;
|
||||
}
|
||||
@@ -165,15 +165,15 @@ void Client::DoTributeUpdate() {
|
||||
if(inst == nullptr)
|
||||
continue;
|
||||
|
||||
PutItemInInventory(TRIBUTE_SLOT_START+r, *inst, false);
|
||||
SendItemPacket(TRIBUTE_SLOT_START+r, inst, ItemPacketTributeItem);
|
||||
PutItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, *inst, false);
|
||||
SendItemPacket(EmuConstants::TRIBUTE_BEGIN + r, inst, ItemPacketTributeItem);
|
||||
safe_delete(inst);
|
||||
}
|
||||
} else {
|
||||
//unequip tribute items...
|
||||
for(r = 0; r < MAX_PLAYER_TRIBUTES; r++) {
|
||||
if(m_inv[TRIBUTE_SLOT_START+r])
|
||||
DeleteItemInInventory(TRIBUTE_SLOT_START+r, 0, false);
|
||||
for(r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) {
|
||||
if (m_inv[EmuConstants::TRIBUTE_BEGIN + r])
|
||||
DeleteItemInInventory(EmuConstants::TRIBUTE_BEGIN + r, 0, false);
|
||||
}
|
||||
}
|
||||
CalcBonuses();
|
||||
@@ -192,7 +192,7 @@ void Client::SendTributeTimer() {
|
||||
|
||||
void Client::ChangeTributeSettings(TributeInfo_Struct *t) {
|
||||
int r;
|
||||
for(r = 0; r < MAX_PLAYER_TRIBUTES; r++) {
|
||||
for(r = 0; r < EmuConstants::TRIBUTE_SIZE; r++) {
|
||||
|
||||
m_pp.tributes[r].tribute = TRIBUTE_NONE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user