Changed ItemTypes to ItemUseTypes

This commit is contained in:
Uleat
2013-10-27 09:04:52 -04:00
parent 0d5fc26841
commit 3e6be197e6
15 changed files with 186 additions and 150 deletions
+3 -3
View File
@@ -846,9 +846,9 @@ void Client::AI_Process()
if (ExtraAttackChanceBonus && GetTarget()) {
ItemInst *wpn = GetInv().GetItem(SLOT_PRIMARY);
if(wpn){
if(wpn->GetItem()->ItemType == ItemType2HS ||
wpn->GetItem()->ItemType == ItemType2HB ||
wpn->GetItem()->ItemType == ItemType2HPierce )
if(wpn->GetItem()->ItemType == ItemType2HSlash ||
wpn->GetItem()->ItemType == ItemType2HBlunt ||
wpn->GetItem()->ItemType == ItemType2HPiercing )
{
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
{
+20 -20
View File
@@ -64,43 +64,43 @@ bool Mob::AttackAnimation(SkillType &skillinuse, int Hand, const ItemInst* weapo
#endif
switch (item->ItemType)
{
case ItemType1HS: // 1H Slashing
case ItemType1HSlash: // 1H Slashing
{
skillinuse = _1H_SLASHING;
type = anim1HWeapon;
break;
}
case ItemType2HS: // 2H Slashing
case ItemType2HSlash: // 2H Slashing
{
skillinuse = _2H_SLASHING;
type = anim2HSlashing;
break;
}
case ItemTypePierce: // Piercing
case ItemType1HPiercing: // Piercing
{
skillinuse = PIERCING;
type = animPiercing;
break;
}
case ItemType1HB: // 1H Blunt
case ItemType1HBlunt: // 1H Blunt
{
skillinuse = _1H_BLUNT;
type = anim1HWeapon;
break;
}
case ItemType2HB: // 2H Blunt
case ItemType2HBlunt: // 2H Blunt
{
skillinuse = _2H_BLUNT;
type = anim2HWeapon;
break;
}
case ItemType2HPierce: // 2H Piercing
case ItemType2HPiercing: // 2H Piercing
{
skillinuse = PIERCING;
type = anim2HWeapon;
break;
}
case ItemTypeHand2Hand:
case ItemTypeMartial:
{
skillinuse = HAND_TO_HAND;
type = animHand2Hand;
@@ -465,7 +465,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
if(equiped2) {
uint8 TwoHandBlunt = CastToClient()->m_inv.GetItem(13)->GetItem()->ItemType;
float bonusStaffBlock = 0.0f;
if(TwoHandBlunt == ItemType2HB) {
if(TwoHandBlunt == ItemType2HBlunt) {
bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock;
RollTable[1] += bonusStaffBlock;
@@ -1771,27 +1771,27 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
}
switch(weapon->ItemType){
case ItemType1HS:
case ItemType1HSlash:
skillinuse = _1H_SLASHING;
break;
case ItemType2HS:
case ItemType2HSlash:
skillinuse = _2H_SLASHING;
break;
case ItemTypePierce:
case ItemType2HPierce:
case ItemType1HPiercing:
case ItemType2HPiercing:
skillinuse = PIERCING;
break;
case ItemType1HB:
case ItemType1HBlunt:
skillinuse = _1H_BLUNT;
break;
case ItemType2HB:
case ItemType2HBlunt:
skillinuse = _2H_BLUNT;
break;
case ItemTypeBow:
skillinuse = ARCHERY;
break;
case ItemTypeThrowing:
case ItemTypeThrowingv2:
case ItemTypeLargeThrowing:
case ItemTypeSmallThrowing:
skillinuse = THROWING;
break;
default:
@@ -2650,7 +2650,7 @@ uint8 Mob::GetWeaponDamageBonus( const Item_Struct *Weapon )
// Assert: This function should not be called unless the player is a melee class, as casters do not receive a damage bonus.
if( Weapon == nullptr || Weapon->ItemType == ItemType1HS || Weapon->ItemType == ItemType1HB || Weapon->ItemType == ItemTypeHand2Hand || Weapon->ItemType == ItemTypePierce )
if( Weapon == nullptr || Weapon->ItemType == ItemType1HSlash || Weapon->ItemType == ItemType1HBlunt || Weapon->ItemType == ItemTypeMartial || Weapon->ItemType == ItemType1HPiercing )
{
// The weapon in the player's main (primary) hand is a one-handed weapon, or there is no item equipped at all.
//
@@ -3935,7 +3935,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct* weapon, Mob *on
bool bRangedAttack = false;
if (weapon != nullptr) {
if (weapon->ItemType == ItemTypeBow || weapon->ItemType == ItemTypeThrowing || weapon->ItemType == ItemTypeThrowingv2) {
if (weapon->ItemType == ItemTypeBow || weapon->ItemType == ItemTypeLargeThrowing || weapon->ItemType == ItemTypeSmallThrowing) {
bRangedAttack = true;
}
}
@@ -3944,8 +3944,8 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct* weapon, Mob *on
if(weapon)
{
if(weapon->ItemType == ItemTypeArrow ||
weapon->ItemType == ItemTypeThrowing ||
weapon->ItemType == ItemTypeThrowingv2 ||
weapon->ItemType == ItemTypeLargeThrowing ||
weapon->ItemType == ItemTypeSmallThrowing ||
weapon->ItemType == ItemTypeBow)
{
isRanged = true;
+42 -42
View File
@@ -1302,37 +1302,37 @@ uint16 Bot::GetPrimarySkillValue()
uint8 type = m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType; //is this the best way to do this?
switch(type)
{
case ItemType1HS: // 1H Slashing
case ItemType1HSlash: // 1H Slashing
{
skill = _1H_SLASHING;
break;
}
case ItemType2HS: // 2H Slashing
case ItemType2HSlash: // 2H Slashing
{
skill = _2H_SLASHING;
break;
}
case ItemTypePierce: // Piercing
case ItemType1HPiercing: // Piercing
{
skill = PIERCING;
break;
}
case ItemType1HB: // 1H Blunt
case ItemType1HBlunt: // 1H Blunt
{
skill = _1H_BLUNT;
break;
}
case ItemType2HB: // 2H Blunt
case ItemType2HBlunt: // 2H Blunt
{
skill = _2H_BLUNT;
break;
}
case ItemType2HPierce: // 2H Piercing
case ItemType2HPiercing: // 2H Piercing
{
skill = PIERCING;
break;
}
case ItemTypeHand2Hand: // Hand to Hand
case ItemTypeMartial: // Hand to Hand
{
skill = HAND_TO_HAND;
break;
@@ -3802,9 +3802,9 @@ void Bot::AI_Process() {
if (GetTarget() && ExtraAttackChanceBonus) {
ItemInst *wpn = GetBotItem(SLOT_PRIMARY);
if(wpn){
if(wpn->GetItem()->ItemType == ItemType2HS ||
wpn->GetItem()->ItemType == ItemType2HB ||
wpn->GetItem()->ItemType == ItemType2HPierce )
if(wpn->GetItem()->ItemType == ItemType2HSlash ||
wpn->GetItem()->ItemType == ItemType2HBlunt ||
wpn->GetItem()->ItemType == ItemType2HPiercing )
{
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
{
@@ -3843,7 +3843,7 @@ void Bot::AI_Process() {
bIsFist = false;
}
if(bIsFist || ((weapontype != ItemType2HS) && (weapontype != ItemType2HPierce) && (weapontype != ItemType2HB))) {
if(bIsFist || ((weapontype != ItemType2HSlash) && (weapontype != ItemType2HPiercing) && (weapontype != ItemType2HBlunt))) {
float DualWieldProbability = 0.0f;
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
@@ -6039,9 +6039,9 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
how_many_slots++;
if(!GetBotItem(j)) {
if(j == SLOT_PRIMARY) {
if((mWeaponItem->ItemType == ItemType2HS) || (mWeaponItem->ItemType == ItemType2HB) || (mWeaponItem->ItemType == ItemType2HPierce)) {
if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(GetBotItem(SLOT_SECONDARY)) {
if(mWeaponItem && (mWeaponItem->ItemType == ItemType2HS) || (mWeaponItem->ItemType == ItemType2HB) || (mWeaponItem->ItemType == ItemType2HPierce)) {
if(mWeaponItem && (mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(client->CheckLoreConflict(GetBotItem(SLOT_SECONDARY)->GetItem())) {
failedLoreCheck = true;
}
@@ -6076,7 +6076,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
if(success) {
if(GetBotItem(SLOT_PRIMARY)) {
ItemInst* remove_item = GetBotItem(SLOT_PRIMARY);
if((remove_item->GetItem()->ItemType == ItemType2HS) || (remove_item->GetItem()->ItemType == ItemType2HB) || (remove_item->GetItem()->ItemType == ItemType2HPierce)) {
if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) {
BotTradeSwapItem(client, SLOT_PRIMARY, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
@@ -6110,7 +6110,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
if(!failedLoreCheck) {
if(j == SLOT_PRIMARY) {
if((mWeaponItem->ItemType == ItemType2HS) || (mWeaponItem->ItemType == ItemType2HB) || (mWeaponItem->ItemType == ItemType2HPierce)) {
if((mWeaponItem->ItemType == ItemType2HSlash) || (mWeaponItem->ItemType == ItemType2HBlunt) || (mWeaponItem->ItemType == ItemType2HPiercing)) {
if(GetBotItem(SLOT_SECONDARY)) {
if(client->CheckLoreConflict(GetBotItem(SLOT_SECONDARY)->GetItem())) {
failedLoreCheck = true;
@@ -6144,7 +6144,7 @@ void Bot::PerformTradeWithClient(int16 beginSlotID, int16 endSlotID, Client* cli
}
if(success && GetBotItem(SLOT_PRIMARY)) {
ItemInst* remove_item = GetBotItem(SLOT_PRIMARY);
if((remove_item->GetItem()->ItemType == ItemType2HS) || (remove_item->GetItem()->ItemType == ItemType2HB) || (remove_item->GetItem()->ItemType == ItemType2HPierce)) {
if((remove_item->GetItem()->ItemType == ItemType2HSlash) || (remove_item->GetItem()->ItemType == ItemType2HBlunt) || (remove_item->GetItem()->ItemType == ItemType2HPiercing)) {
BotTradeSwapItem(client, SLOT_PRIMARY, 0, remove_item, remove_item->GetItem()->Slots, &TempErrorMessage, false);
}
}
@@ -7897,7 +7897,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte)
if(equiped2) {
uint8 TwoHandBlunt = GetBotItem(SLOT_PRIMARY)->GetItem()->ItemType;
float bonusStaffBlock = 0.0f;
if(TwoHandBlunt == ItemType2HB) {
if(TwoHandBlunt == ItemType2HBlunt) {
bonusStaffBlock = aabonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock;
RollTable[1] = RollTable[0] + bonusStaffBlock;
@@ -8138,7 +8138,7 @@ void Bot::TryBackstab(Mob *other, int ReuseTime) {
const Item_Struct* botpiercer = nullptr;
if(inst)
botpiercer = inst->GetItem();
if(!botpiercer || (botpiercer->ItemType != ItemTypePierce)) {
if(!botpiercer || (botpiercer->ItemType != ItemType1HPiercing)) {
Say("I can't backstab with this weapon!");
return;
}
@@ -8381,9 +8381,9 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
bool canBash = false;
if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) // Racial Slam
|| (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield
|| (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HS
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HB
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPierce)
|| (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HSlash
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HBlunt
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPiercing)
&& GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash
canBash = true;
}
@@ -8408,9 +8408,9 @@ void Bot::DoClassAttacks(Mob *target, bool IsRiposte) {
if(level >= RuleI(Combat, NPCBashKickLevel)){
if((GetRace() == OGRE || GetRace() == TROLL || GetRace() == BARBARIAN) // Racial Slam
|| (m_inv.GetItem(SLOT_SECONDARY) && m_inv.GetItem(SLOT_SECONDARY)->GetItem()->ItemType == ItemTypeShield) //Using Shield
|| (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HS
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HB
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPierce)
|| (m_inv.GetItem(SLOT_PRIMARY) && (m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HSlash
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HBlunt
|| m_inv.GetItem(SLOT_PRIMARY)->GetItem()->ItemType == ItemType2HPiercing)
&& GetAA(aa2HandBash) >= 1)) { //Using 2 hand weapon, but has AA 2 Hand Bash
skill_to_use = BASH;
}
@@ -9027,9 +9027,9 @@ void Bot::SetAttackTimer() {
//if we have a 2H weapon in our main hand, no dual
if(PrimaryWeapon != nullptr) {
if( PrimaryWeapon->ItemClass == ItemClassCommon
&& (PrimaryWeapon->ItemType == ItemType2HS
|| PrimaryWeapon->ItemType == ItemType2HB
|| PrimaryWeapon->ItemType == ItemType2HPierce)) {
&& (PrimaryWeapon->ItemType == ItemType2HSlash
|| PrimaryWeapon->ItemType == ItemType2HBlunt
|| PrimaryWeapon->ItemType == ItemType2HPiercing)) {
attack_dw_timer.Disable();
continue;
}
@@ -9052,7 +9052,7 @@ void Bot::SetAttackTimer() {
ItemToUse = nullptr;
}
// Check to see if skill is valid
else if((ItemToUse->ItemType > ItemTypeThrowing) && (ItemToUse->ItemType != ItemTypeHand2Hand) && (ItemToUse->ItemType != ItemType2HPierce)) {
else if((ItemToUse->ItemType > ItemTypeLargeThrowing) && (ItemToUse->ItemType != ItemTypeMartial) && (ItemToUse->ItemType != ItemType2HPiercing)) {
//no weapon
ItemToUse = nullptr;
}
@@ -9088,7 +9088,7 @@ void Bot::SetAttackTimer() {
if(speed < RuleI(Combat, MinHastedDelay))
speed = RuleI(Combat, MinHastedDelay);
if(ItemToUse && (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeThrowing))
if(ItemToUse && (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeLargeThrowing))
{
/*if(IsClient())
{
@@ -11430,17 +11430,17 @@ void Bot::CalcItemBonuses()
if(itembonuses.haste < itemtmp->Haste)
itembonuses.haste = itemtmp->Haste;
if(GetClass() == BARD && itemtmp->BardValue != 0) {
if(itemtmp->BardType == ItemTypeBrassInstr)
if(itemtmp->BardType == ItemTypeBrassInstrument)
itembonuses.brassMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeDrumInstr)
else if(itemtmp->BardType == ItemTypePercussionInstrument)
itembonuses.percussionMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseSinging)
else if(itemtmp->BardType == ItemTypeSinging)
itembonuses.singingMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeStringInstr)
else if(itemtmp->BardType == ItemTypeStringedInstrument)
itembonuses.stringedMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeWindInstr)
else if(itemtmp->BardType == ItemTypeWindInstrument)
itembonuses.windMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseAllInstruments) {
else if(itemtmp->BardType == ItemTypeAllInstrumentTypes) {
itembonuses.brassMod += itemtmp->BardValue;
itembonuses.percussionMod += itemtmp->BardValue;
itembonuses.singingMod += itemtmp->BardValue;
@@ -11514,17 +11514,17 @@ void Bot::CalcItemBonuses()
if(itembonuses.haste < itemtmp->Haste)
itembonuses.haste = itemtmp->Haste;
if(GetClass() == BARD && itemtmp->BardValue != 0) {
if(itemtmp->BardType == ItemTypeBrassInstr)
if(itemtmp->BardType == ItemTypeBrassInstrument)
itembonuses.brassMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeDrumInstr)
else if(itemtmp->BardType == ItemTypePercussionInstrument)
itembonuses.percussionMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseSinging)
else if(itemtmp->BardType == ItemTypeSinging)
itembonuses.singingMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeStringInstr)
else if(itemtmp->BardType == ItemTypeStringedInstrument)
itembonuses.stringedMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemTypeWindInstr)
else if(itemtmp->BardType == ItemTypeWindInstrument)
itembonuses.windMod += itemtmp->BardValue;
else if(itemtmp->BardType == ItemUseAllInstruments) {
else if(itemtmp->BardType == ItemTypeAllInstrumentTypes) {
itembonuses.brassMod += itemtmp->BardValue;
itembonuses.percussionMod += itemtmp->BardValue;
itembonuses.singingMod += itemtmp->BardValue;
@@ -12235,7 +12235,7 @@ void Bot::ProcessBotCommands(Client *c, const Seperator *sep) {
c->Message(15, "I need something for my %s (Item %i)", equipped[i], i);
continue;
}
if((i == 13) && ((item2->ItemType == ItemType2HS) || (item2->ItemType == ItemType2HB) || (item2->ItemType == ItemType2HPierce))) {
if((i == 13) && ((item2->ItemType == ItemType2HSlash) || (item2->ItemType == ItemType2HBlunt) || (item2->ItemType == ItemType2HPiercing))) {
is2Hweapon = true;
}
+7 -7
View File
@@ -3985,37 +3985,37 @@ uint16 Client::GetPrimarySkillValue()
switch (type)
{
case ItemType1HS: // 1H Slashing
case ItemType1HSlash: // 1H Slashing
{
skill = _1H_SLASHING;
break;
}
case ItemType2HS: // 2H Slashing
case ItemType2HSlash: // 2H Slashing
{
skill = _2H_SLASHING;
break;
}
case ItemTypePierce: // Piercing
case ItemType1HPiercing: // Piercing
{
skill = PIERCING;
break;
}
case ItemType1HB: // 1H Blunt
case ItemType1HBlunt: // 1H Blunt
{
skill = _1H_BLUNT;
break;
}
case ItemType2HB: // 2H Blunt
case ItemType2HBlunt: // 2H Blunt
{
skill = _2H_BLUNT;
break;
}
case ItemType2HPierce: // 2H Piercing
case ItemType2HPiercing: // 2H Piercing
{
skill = PIERCING;
break;
}
case ItemTypeHand2Hand: // Hand to Hand
case ItemTypeMartial: // Hand to Hand
{
skill = HAND_TO_HAND;
break;
+1 -1
View File
@@ -1174,7 +1174,7 @@ public:
int32 mod_client_xp(int32 in_exp, NPC *npc);
uint32 mod_client_xp_for_level(uint32 xp, uint16 check_level);
int mod_client_haste_cap(int cap);
int mod_consume(Item_Struct *item, ItemTypes type, int change);
int mod_consume(Item_Struct *item, ItemUseTypes type, int change);
int mod_food_value(const Item_Struct *item, int change);
int mod_drink_value(const Item_Struct *item, int change);
+2 -2
View File
@@ -11029,8 +11029,8 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) {
}
else if(GetClass() == ROGUE)
{
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == ItemTypePierce) ||
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == ItemTypePierce)) {
if ((PrimaryWeapon && PrimaryWeapon->GetItem()->ItemType == ItemType1HPiercing) ||
(SecondaryWeapon && SecondaryWeapon->GetItem()->ItemType == ItemType1HPiercing)) {
float SuccessChance = (GetSkill(APPLY_POISON) + GetLevel()) / 400.0f;
double ChanceRoll = MakeRandomFloat(0, 1);
+4 -4
View File
@@ -314,7 +314,7 @@ bool Client::Process() {
ranged_timer.Start();
}
}
else if(ranged->GetItem() && (ranged->GetItem()->ItemType == ItemTypeThrowing || ranged->GetItem()->ItemType == ItemTypeThrowingv2)){
else if(ranged->GetItem() && (ranged->GetItem()->ItemType == ItemTypeLargeThrowing || ranged->GetItem()->ItemType == ItemTypeSmallThrowing)){
if(ranged_timer.Check(false)){
if(GetTarget() && (GetTarget()->IsNPC() || GetTarget()->IsClient())){
if(!GetTarget()->BehindMob(this, GetTarget()->GetX(), GetTarget()->GetY())){
@@ -449,9 +449,9 @@ bool Client::Process() {
if (auto_attack_target && ExtraAttackChanceBonus) {
ItemInst *wpn = GetInv().GetItem(SLOT_PRIMARY);
if(wpn){
if(wpn->GetItem()->ItemType == ItemType2HS ||
wpn->GetItem()->ItemType == ItemType2HB ||
wpn->GetItem()->ItemType == ItemType2HPierce )
if(wpn->GetItem()->ItemType == ItemType2HSlash ||
wpn->GetItem()->ItemType == ItemType2HBlunt ||
wpn->GetItem()->ItemType == ItemType2HPiercing )
{
if(MakeRandomInt(0, 100) < ExtraAttackChanceBonus)
{
+3 -3
View File
@@ -633,7 +633,7 @@ bool Client::TryStacking(ItemInst* item, uint8 type, bool try_worn, bool try_cur
bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_cursor, ServerLootItem_Struct** bag_item_data)
{
// #1: Try to auto equip
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && !inst.GetItem()->Attuneable && inst.GetItem()->ItemType != ItemTypeAugment)
if (try_worn && inst.IsEquipable(GetBaseRace(), GetClass()) && inst.GetItem()->ReqLevel<=level && !inst.GetItem()->Attuneable && inst.GetItem()->ItemType != ItemTypeAugmentation)
{
for (int16 i = 0; i < 9999; i++) // originally (i < 22)
{
@@ -646,7 +646,7 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
{
if( i == SLOT_PRIMARY && inst.IsWeapon() ) // If item is primary slot weapon
{
if( (inst.GetItem()->ItemType == ItemType2HS) || (inst.GetItem()->ItemType == ItemType2HB) || (inst.GetItem()->ItemType == ItemType2HPierce) ) // and uses 2hs \ 2hb \ 2hp
if( (inst.GetItem()->ItemType == ItemType2HSlash) || (inst.GetItem()->ItemType == ItemType2HBlunt) || (inst.GetItem()->ItemType == ItemType2HPiercing) ) // and uses 2hs \ 2hb \ 2hp
{
if( m_inv[SLOT_SECONDARY] ) // and if secondary slot is not empty
{
@@ -657,7 +657,7 @@ bool Client::AutoPutLootInInventory(ItemInst& inst, bool try_worn, bool try_curs
if( i== SLOT_SECONDARY && m_inv[SLOT_PRIMARY]) // check to see if primary slot is a two hander
{
uint8 use = m_inv[SLOT_PRIMARY]->GetItem()->ItemType;
if(use == ItemType2HS || use == ItemType2HB || use == ItemType2HPierce)
if(use == ItemType2HSlash || use == ItemType2HBlunt || use == ItemType2HPiercing)
continue;
}
if
+2 -2
View File
@@ -282,8 +282,8 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
}
else if (foundslot == SLOT_SECONDARY
&& (GetOwner() != nullptr || (GetLevel() >= 13 && MakeRandomInt(0,99) < NPC_DW_CHANCE) || (item2->Damage==0)) &&
(item2->ItemType == ItemType1HS || item2->ItemType == ItemType1HB || item2->ItemType == ItemTypeShield ||
item2->ItemType == ItemTypePierce))
(item2->ItemType == ItemType1HSlash || item2->ItemType == ItemType1HBlunt || item2->ItemType == ItemTypeShield ||
item2->ItemType == ItemType1HPiercing))
{
if (item2->Proc.Effect!=0)
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
+1 -1
View File
@@ -1715,7 +1715,7 @@ void Merc::AI_Process() {
int weapontype = 0; // No weapon type
bool bIsFist = true;
if(bIsFist || ((weapontype != ItemType2HS) && (weapontype != ItemType2HPierce) && (weapontype != ItemType2HB))) {
if(bIsFist || ((weapontype != ItemType2HSlash) && (weapontype != ItemType2HPiercing) && (weapontype != ItemType2HBlunt))) {
float DualWieldProbability = 0.0f;
int16 Ambidexterity = aabonuses.Ambidexterity + spellbonuses.Ambidexterity + itembonuses.Ambidexterity;
+13 -13
View File
@@ -1969,9 +1969,9 @@ void Mob::SetAttackTimer() {
//if we have a 2H weapon in our main hand, no dual
if(PrimaryWeapon != nullptr) {
if( PrimaryWeapon->ItemClass == ItemClassCommon
&& (PrimaryWeapon->ItemType == ItemType2HS
|| PrimaryWeapon->ItemType == ItemType2HB
|| PrimaryWeapon->ItemType == ItemType2HPierce)) {
&& (PrimaryWeapon->ItemType == ItemType2HSlash
|| PrimaryWeapon->ItemType == ItemType2HBlunt
|| PrimaryWeapon->ItemType == ItemType2HPiercing)) {
attack_dw_timer.Disable();
continue;
}
@@ -2003,7 +2003,7 @@ void Mob::SetAttackTimer() {
ItemToUse = nullptr;
}
// Check to see if skill is valid
else if((ItemToUse->ItemType > ItemTypeThrowing) && (ItemToUse->ItemType != ItemTypeHand2Hand) && (ItemToUse->ItemType != ItemType2HPierce)) {
else if((ItemToUse->ItemType > ItemTypeLargeThrowing) && (ItemToUse->ItemType != ItemTypeMartial) && (ItemToUse->ItemType != ItemType2HPiercing)) {
//no weapon
ItemToUse = nullptr;
}
@@ -2039,7 +2039,7 @@ void Mob::SetAttackTimer() {
if(speed < RuleI(Combat, MinHastedDelay))
speed = RuleI(Combat, MinHastedDelay);
if(ItemToUse && (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeThrowing))
if(ItemToUse && (ItemToUse->ItemType == ItemTypeBow || ItemToUse->ItemType == ItemTypeLargeThrowing))
{
if(IsClient())
{
@@ -2083,7 +2083,7 @@ bool Mob::CanThisClassDualWield(void) const
// 2HS, 2HB, or 2HP
if (inst && inst->IsType(ItemClassCommon)) {
const Item_Struct* item = inst->GetItem();
if ((item->ItemType == ItemType2HB) || (item->ItemType == ItemType2HS) || (item->ItemType == ItemType2HPierce))
if ((item->ItemType == ItemType2HBlunt) || (item->ItemType == ItemType2HSlash) || (item->ItemType == ItemType2HPiercing))
return false;
} else {
//No weapon in hand... using hand-to-hand...
@@ -4536,19 +4536,19 @@ uint16 Mob::GetSkillByItemType(int ItemType)
{
switch (ItemType)
{
case ItemType1HS:
case ItemType1HSlash:
return _1H_SLASHING;
case ItemType2HS:
case ItemType2HSlash:
return _2H_SLASHING;
case ItemTypePierce:
case ItemType1HPiercing:
return PIERCING;
case ItemType1HB:
case ItemType1HBlunt:
return _1H_BLUNT;
case ItemType2HB:
case ItemType2HBlunt:
return _2H_BLUNT;
case ItemType2HPierce:
case ItemType2HPiercing:
return PIERCING;
case ItemTypeHand2Hand:
case ItemTypeMartial:
return HAND_TO_HAND;
default:
return HAND_TO_HAND;
+2 -2
View File
@@ -506,7 +506,7 @@ void Mob::TryBackstab(Mob *other, int ReuseTime) {
//make sure we have a proper weapon if we are a client.
if(IsClient()) {
const ItemInst *wpn = CastToClient()->GetInv().GetItem(SLOT_PRIMARY);
if(!wpn || (wpn->GetItem()->ItemType != ItemTypePierce)){
if(!wpn || (wpn->GetItem()->ItemType != ItemType1HPiercing)){
Message_StringID(13, BACKSTAB_WEAPON);
return;
}
@@ -1138,7 +1138,7 @@ void Client::ThrowingAttack(Mob* other) { //old was 51
}
const Item_Struct* item = RangeWeapon->GetItem();
if(item->ItemType != ItemTypeThrowing && item->ItemType != ItemTypeThrowingv2) {
if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) {
mlog(COMBAT__RANGED, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType);
Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(SLOT_RANGE));
return;