mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Converted MATERIAL defines to MaterialUseSlots enumeration
This commit is contained in:
+1
-1
@@ -1312,7 +1312,7 @@ void Mob::AI_Process() {
|
||||
{
|
||||
int myclass = GetClass();
|
||||
//can only dual wield without a weapon if your a monk
|
||||
if(GetSpecialAbility(SPECATK_INNATE_DW) || (GetEquipment(MATERIAL_SECONDARY) != 0 && GetLevel() > 29) || myclass == MONK || myclass == MONKGM) {
|
||||
if(GetSpecialAbility(SPECATK_INNATE_DW) || (GetEquipment(MaterialSecondary) != 0 && GetLevel() > 29) || myclass == MONK || myclass == MONKGM) {
|
||||
float DualWieldProbability = (GetSkill(DUAL_WIELD) + GetLevel()) / 400.0f;
|
||||
if(MakeRandomFloat(0.0, 1.0) < DualWieldProbability)
|
||||
{
|
||||
|
||||
+23
-23
@@ -4584,8 +4584,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
ns->spawn.equipment[MATERIAL_HANDS] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_HANDS].color = GetEquipmentColor(MATERIAL_HANDS);
|
||||
ns->spawn.equipment[MaterialHands] = item->Material;
|
||||
ns->spawn.colors[MaterialHands].color = GetEquipmentColor(MaterialHands);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4593,8 +4593,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
ns->spawn.equipment[MATERIAL_HEAD] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_HEAD].color = GetEquipmentColor(MATERIAL_HEAD);
|
||||
ns->spawn.equipment[MaterialHead] = item->Material;
|
||||
ns->spawn.colors[MaterialHead].color = GetEquipmentColor(MaterialHead);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4602,8 +4602,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
ns->spawn.equipment[MATERIAL_ARMS] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_ARMS].color = GetEquipmentColor(MATERIAL_ARMS);
|
||||
ns->spawn.equipment[MaterialArms] = item->Material;
|
||||
ns->spawn.colors[MaterialArms].color = GetEquipmentColor(MaterialArms);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4611,8 +4611,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
ns->spawn.equipment[MATERIAL_BRACER] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_BRACER].color = GetEquipmentColor(MATERIAL_BRACER);
|
||||
ns->spawn.equipment[MaterialWrist] = item->Material;
|
||||
ns->spawn.colors[MaterialWrist].color = GetEquipmentColor(MaterialWrist);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4620,8 +4620,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
ns->spawn.equipment[MATERIAL_BRACER] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_BRACER].color = GetEquipmentColor(MATERIAL_BRACER);
|
||||
ns->spawn.equipment[MaterialWrist] = item->Material;
|
||||
ns->spawn.colors[MaterialWrist].color = GetEquipmentColor(MaterialWrist);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4629,8 +4629,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
ns->spawn.equipment[MATERIAL_CHEST] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_CHEST].color = GetEquipmentColor(MATERIAL_CHEST);
|
||||
ns->spawn.equipment[MaterialChest] = item->Material;
|
||||
ns->spawn.colors[MaterialChest].color = GetEquipmentColor(MaterialChest);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4638,8 +4638,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
ns->spawn.equipment[MATERIAL_LEGS] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_LEGS].color = GetEquipmentColor(MATERIAL_LEGS);
|
||||
ns->spawn.equipment[MaterialLegs] = item->Material;
|
||||
ns->spawn.colors[MaterialLegs].color = GetEquipmentColor(MaterialLegs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4647,8 +4647,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
if(inst) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
ns->spawn.equipment[MATERIAL_FEET] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_FEET].color = GetEquipmentColor(MATERIAL_FEET);
|
||||
ns->spawn.equipment[MaterialFeet] = item->Material;
|
||||
ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4657,8 +4657,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
if(strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment[MATERIAL_PRIMARY] = atoi(&item->IDFile[2]);
|
||||
ns->spawn.colors[MATERIAL_PRIMARY].color = GetEquipmentColor(MATERIAL_PRIMARY);
|
||||
ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]);
|
||||
ns->spawn.colors[MaterialPrimary].color = GetEquipmentColor(MaterialPrimary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4667,8 +4667,8 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
item = inst->GetItem();
|
||||
if(item) {
|
||||
if(strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment[MATERIAL_SECONDARY] = atoi(&item->IDFile[2]);
|
||||
ns->spawn.colors[MATERIAL_SECONDARY].color = GetEquipmentColor(MATERIAL_SECONDARY);
|
||||
ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]);
|
||||
ns->spawn.colors[MaterialSecondary].color = GetEquipmentColor(MaterialSecondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5431,8 +5431,8 @@ void Bot::BotRemoveEquipItem(int slot) {
|
||||
if(materialFromSlot != 0xFF) {
|
||||
equipment[slot] = 0; // npc has more than just material slots. Valid material should mean valid inventory index
|
||||
SendWearChange(materialFromSlot);
|
||||
if(materialFromSlot == MATERIAL_CHEST)
|
||||
SendWearChange(MATERIAL_ARMS);
|
||||
if(materialFromSlot == MaterialChest)
|
||||
SendWearChange(MaterialArms);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7981,7 +7981,7 @@ int Bot::GetMonkHandToHandDamage(void)
|
||||
// Have a look to see if we have epic fists on
|
||||
|
||||
uint32 botWeaponId = INVALID_ID;
|
||||
botWeaponId = CastToNPC()->GetEquipment(MATERIAL_HANDS);
|
||||
botWeaponId = CastToNPC()->GetEquipment(MaterialHands);
|
||||
if(botWeaponId == 10652) { //Monk Epic ID
|
||||
return 9;
|
||||
}
|
||||
|
||||
+53
-53
@@ -1858,53 +1858,53 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
||||
const ItemInst* inst = nullptr;
|
||||
if ((inst = m_inv[SLOT_HANDS]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_HANDS] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_HANDS].color = GetEquipmentColor(MATERIAL_HANDS);
|
||||
ns->spawn.equipment[MaterialHands] = item->Material;
|
||||
ns->spawn.colors[MaterialHands].color = GetEquipmentColor(MaterialHands);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_HEAD]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_HEAD] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_HEAD].color = GetEquipmentColor(MATERIAL_HEAD);
|
||||
ns->spawn.equipment[MaterialHead] = item->Material;
|
||||
ns->spawn.colors[MaterialHead].color = GetEquipmentColor(MaterialHead);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_ARMS]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_ARMS] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_ARMS].color = GetEquipmentColor(MATERIAL_ARMS);
|
||||
ns->spawn.equipment[MaterialArms] = item->Material;
|
||||
ns->spawn.colors[MaterialArms].color = GetEquipmentColor(MaterialArms);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_BRACER01]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_BRACER]= item->Material;
|
||||
ns->spawn.colors[MATERIAL_BRACER].color = GetEquipmentColor(MATERIAL_BRACER);
|
||||
ns->spawn.equipment[MaterialWrist]= item->Material;
|
||||
ns->spawn.colors[MaterialWrist].color = GetEquipmentColor(MaterialWrist);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_BRACER02]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_BRACER]= item->Material;
|
||||
ns->spawn.colors[MATERIAL_BRACER].color = GetEquipmentColor(MATERIAL_BRACER);
|
||||
ns->spawn.equipment[MaterialWrist]= item->Material;
|
||||
ns->spawn.colors[MaterialWrist].color = GetEquipmentColor(MaterialWrist);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_CHEST]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_CHEST] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_CHEST].color = GetEquipmentColor(MATERIAL_CHEST);
|
||||
ns->spawn.equipment[MaterialChest] = item->Material;
|
||||
ns->spawn.colors[MaterialChest].color = GetEquipmentColor(MaterialChest);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_LEGS]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_LEGS] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_LEGS].color = GetEquipmentColor(MATERIAL_LEGS);
|
||||
ns->spawn.equipment[MaterialLegs] = item->Material;
|
||||
ns->spawn.colors[MaterialLegs].color = GetEquipmentColor(MaterialLegs);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_FEET]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
ns->spawn.equipment[MATERIAL_FEET] = item->Material;
|
||||
ns->spawn.colors[MATERIAL_FEET].color = GetEquipmentColor(MATERIAL_FEET);
|
||||
ns->spawn.equipment[MaterialFeet] = item->Material;
|
||||
ns->spawn.colors[MaterialFeet].color = GetEquipmentColor(MaterialFeet);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_PRIMARY]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
if (strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment[MATERIAL_PRIMARY] = atoi(&item->IDFile[2]);
|
||||
ns->spawn.equipment[MaterialPrimary] = atoi(&item->IDFile[2]);
|
||||
}
|
||||
if ((inst = m_inv[SLOT_SECONDARY]) && inst->IsType(ItemClassCommon)) {
|
||||
item = inst->GetItem();
|
||||
if (strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment[MATERIAL_SECONDARY] = atoi(&item->IDFile[2]);
|
||||
ns->spawn.equipment[MaterialSecondary] = atoi(&item->IDFile[2]);
|
||||
}
|
||||
|
||||
//these two may be related to ns->spawn.texture
|
||||
@@ -2762,25 +2762,25 @@ void Client::SetMaterial(int16 in_slot, uint32 item_id){
|
||||
const Item_Struct* item = database.GetItem(item_id);
|
||||
if (item && (item->ItemClass==ItemClassCommon)) {
|
||||
if (in_slot==SLOT_HEAD)
|
||||
m_pp.item_material[MATERIAL_HEAD] = item->Material;
|
||||
m_pp.item_material[MaterialHead] = item->Material;
|
||||
else if (in_slot==SLOT_CHEST)
|
||||
m_pp.item_material[MATERIAL_CHEST] = item->Material;
|
||||
m_pp.item_material[MaterialChest] = item->Material;
|
||||
else if (in_slot==SLOT_ARMS)
|
||||
m_pp.item_material[MATERIAL_ARMS] = item->Material;
|
||||
m_pp.item_material[MaterialArms] = item->Material;
|
||||
else if (in_slot==SLOT_BRACER01)
|
||||
m_pp.item_material[MATERIAL_BRACER] = item->Material;
|
||||
m_pp.item_material[MaterialWrist] = item->Material;
|
||||
else if (in_slot==SLOT_BRACER02)
|
||||
m_pp.item_material[MATERIAL_BRACER] = item->Material;
|
||||
m_pp.item_material[MaterialWrist] = item->Material;
|
||||
else if (in_slot==SLOT_HANDS)
|
||||
m_pp.item_material[MATERIAL_HANDS] = item->Material;
|
||||
m_pp.item_material[MaterialHands] = item->Material;
|
||||
else if (in_slot==SLOT_LEGS)
|
||||
m_pp.item_material[MATERIAL_LEGS] = item->Material;
|
||||
m_pp.item_material[MaterialLegs] = item->Material;
|
||||
else if (in_slot==SLOT_FEET)
|
||||
m_pp.item_material[MATERIAL_FEET] = item->Material;
|
||||
m_pp.item_material[MaterialFeet] = item->Material;
|
||||
else if (in_slot==SLOT_PRIMARY)
|
||||
m_pp.item_material[MATERIAL_PRIMARY] = atoi(item->IDFile+2);
|
||||
m_pp.item_material[MaterialPrimary] = atoi(item->IDFile+2);
|
||||
else if (in_slot==SLOT_SECONDARY)
|
||||
m_pp.item_material[MATERIAL_SECONDARY] = atoi(item->IDFile+2);
|
||||
m_pp.item_material[MaterialSecondary] = atoi(item->IDFile+2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2963,25 +2963,25 @@ void Client::SetTint(int16 in_slot, uint32 color) {
|
||||
// Still need to reconcile bracer01 versus bracer02
|
||||
void Client::SetTint(int16 in_slot, Color_Struct& color) {
|
||||
if (in_slot==SLOT_HEAD)
|
||||
m_pp.item_tint[MATERIAL_HEAD].color=color.color;
|
||||
m_pp.item_tint[MaterialHead].color=color.color;
|
||||
else if (in_slot==SLOT_ARMS)
|
||||
m_pp.item_tint[MATERIAL_ARMS].color=color.color;
|
||||
m_pp.item_tint[MaterialArms].color=color.color;
|
||||
else if (in_slot==SLOT_BRACER01)
|
||||
m_pp.item_tint[MATERIAL_BRACER].color=color.color;
|
||||
m_pp.item_tint[MaterialWrist].color=color.color;
|
||||
else if (in_slot==SLOT_BRACER02)
|
||||
m_pp.item_tint[MATERIAL_BRACER].color=color.color;
|
||||
m_pp.item_tint[MaterialWrist].color=color.color;
|
||||
else if (in_slot==SLOT_HANDS)
|
||||
m_pp.item_tint[MATERIAL_HANDS].color=color.color;
|
||||
m_pp.item_tint[MaterialHands].color=color.color;
|
||||
else if (in_slot==SLOT_PRIMARY)
|
||||
m_pp.item_tint[MATERIAL_PRIMARY].color=color.color;
|
||||
m_pp.item_tint[MaterialPrimary].color=color.color;
|
||||
else if (in_slot==SLOT_SECONDARY)
|
||||
m_pp.item_tint[MATERIAL_SECONDARY].color=color.color;
|
||||
m_pp.item_tint[MaterialSecondary].color=color.color;
|
||||
else if (in_slot==SLOT_CHEST)
|
||||
m_pp.item_tint[MATERIAL_CHEST].color=color.color;
|
||||
m_pp.item_tint[MaterialChest].color=color.color;
|
||||
else if (in_slot==SLOT_LEGS)
|
||||
m_pp.item_tint[MATERIAL_LEGS].color=color.color;
|
||||
m_pp.item_tint[MaterialLegs].color=color.color;
|
||||
else if (in_slot==SLOT_FEET)
|
||||
m_pp.item_tint[MATERIAL_FEET].color=color.color;
|
||||
m_pp.item_tint[MaterialFeet].color=color.color;
|
||||
}
|
||||
|
||||
void Client::SetHideMe(bool flag)
|
||||
@@ -3050,25 +3050,25 @@ uint8 Client::SlotConvert(uint8 slot,bool bracer){
|
||||
if(bracer)
|
||||
return SLOT_BRACER02;
|
||||
switch(slot){
|
||||
case MATERIAL_HEAD:
|
||||
case MaterialHead:
|
||||
slot2=SLOT_HEAD;
|
||||
break;
|
||||
case MATERIAL_CHEST:
|
||||
case MaterialChest:
|
||||
slot2=SLOT_CHEST;
|
||||
break;
|
||||
case MATERIAL_ARMS:
|
||||
case MaterialArms:
|
||||
slot2=SLOT_ARMS;
|
||||
break;
|
||||
case MATERIAL_BRACER:
|
||||
case MaterialWrist:
|
||||
slot2=SLOT_BRACER01;
|
||||
break;
|
||||
case MATERIAL_HANDS:
|
||||
case MaterialHands:
|
||||
slot2=SLOT_HANDS;
|
||||
break;
|
||||
case MATERIAL_LEGS:
|
||||
case MaterialLegs:
|
||||
slot2=SLOT_LEGS;
|
||||
break;
|
||||
case MATERIAL_FEET:
|
||||
case MaterialFeet:
|
||||
slot2=SLOT_FEET;
|
||||
break;
|
||||
}
|
||||
@@ -3079,25 +3079,25 @@ uint8 Client::SlotConvert2(uint8 slot){
|
||||
uint8 slot2=0;
|
||||
switch(slot){
|
||||
case SLOT_HEAD:
|
||||
slot2=MATERIAL_HEAD;
|
||||
slot2=MaterialHead;
|
||||
break;
|
||||
case SLOT_CHEST:
|
||||
slot2=MATERIAL_CHEST;
|
||||
slot2=MaterialChest;
|
||||
break;
|
||||
case SLOT_ARMS:
|
||||
slot2=MATERIAL_ARMS;
|
||||
slot2=MaterialArms;
|
||||
break;
|
||||
case SLOT_BRACER01:
|
||||
slot2=MATERIAL_BRACER;
|
||||
slot2=MaterialWrist;
|
||||
break;
|
||||
case SLOT_HANDS:
|
||||
slot2=MATERIAL_HANDS;
|
||||
slot2=MaterialHands;
|
||||
break;
|
||||
case SLOT_LEGS:
|
||||
slot2=MATERIAL_LEGS;
|
||||
slot2=MaterialLegs;
|
||||
break;
|
||||
case SLOT_FEET:
|
||||
slot2=MATERIAL_FEET;
|
||||
slot2=MaterialFeet;
|
||||
break;
|
||||
}
|
||||
return slot2;
|
||||
@@ -6122,7 +6122,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
||||
made_npc->drakkin_details = GetDrakkinDetails();
|
||||
made_npc->d_meele_texture1 = GetEquipmentMaterial(7);
|
||||
made_npc->d_meele_texture2 = GetEquipmentMaterial(8);
|
||||
for (int i = 0; i < MAX_MATERIALS; i++) {
|
||||
for (int i = 0; i < _MaterialCount; i++) {
|
||||
made_npc->armor_tint[i] = GetEquipmentColor(i);
|
||||
}
|
||||
made_npc->loottable_id = 0;
|
||||
|
||||
+9
-9
@@ -278,7 +278,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
if (item2->Proc.Effect != 0)
|
||||
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
|
||||
|
||||
eslot = MATERIAL_PRIMARY;
|
||||
eslot = MaterialPrimary;
|
||||
}
|
||||
else if (foundslot == SLOT_SECONDARY
|
||||
&& (GetOwner() != nullptr || (GetLevel() >= 13 && MakeRandomInt(0,99) < NPC_DW_CHANCE) || (item2->Damage==0)) &&
|
||||
@@ -288,28 +288,28 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
|
||||
if (item2->Proc.Effect!=0)
|
||||
CastToMob()->AddProcToWeapon(item2->Proc.Effect, true);
|
||||
|
||||
eslot = MATERIAL_SECONDARY;
|
||||
eslot = MaterialSecondary;
|
||||
}
|
||||
else if (foundslot == SLOT_HEAD) {
|
||||
eslot = MATERIAL_HEAD;
|
||||
eslot = MaterialHead;
|
||||
}
|
||||
else if (foundslot == SLOT_CHEST) {
|
||||
eslot = MATERIAL_CHEST;
|
||||
eslot = MaterialChest;
|
||||
}
|
||||
else if (foundslot == SLOT_ARMS) {
|
||||
eslot = MATERIAL_ARMS;
|
||||
eslot = MaterialArms;
|
||||
}
|
||||
else if (foundslot == SLOT_BRACER01 || foundslot == SLOT_BRACER02) {
|
||||
eslot = MATERIAL_BRACER;
|
||||
eslot = MaterialWrist;
|
||||
}
|
||||
else if (foundslot == SLOT_HANDS) {
|
||||
eslot = MATERIAL_HANDS;
|
||||
eslot = MaterialHands;
|
||||
}
|
||||
else if (foundslot == SLOT_LEGS) {
|
||||
eslot = MATERIAL_LEGS;
|
||||
eslot = MaterialLegs;
|
||||
}
|
||||
else if (foundslot == SLOT_FEET) {
|
||||
eslot = MATERIAL_FEET;
|
||||
eslot = MaterialFeet;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+13
-10
@@ -1323,16 +1323,19 @@ luabind::scope lua_register_material() {
|
||||
return luabind::class_<Materials>("Material")
|
||||
.enum_("constants")
|
||||
[
|
||||
luabind::value("Head", MATERIAL_HEAD),
|
||||
luabind::value("Chest", MATERIAL_CHEST),
|
||||
luabind::value("Arms", MATERIAL_ARMS),
|
||||
luabind::value("Bracer", MATERIAL_BRACER),
|
||||
luabind::value("Hands", MATERIAL_HANDS),
|
||||
luabind::value("Legs", MATERIAL_LEGS),
|
||||
luabind::value("Feet", MATERIAL_FEET),
|
||||
luabind::value("Primary", MATERIAL_PRIMARY),
|
||||
luabind::value("Secondary", MATERIAL_SECONDARY),
|
||||
luabind::value("Max", MAX_MATERIALS)
|
||||
luabind::value("Head", static_cast<int>(MaterialHead)),
|
||||
luabind::value("Chest", static_cast<int>(MaterialChest)),
|
||||
luabind::value("Arms", static_cast<int>(MaterialArms)),
|
||||
luabind::value("Bracer", static_cast<int>(MaterialWrist)), // deprecated
|
||||
luabind::value("Wrist", static_cast<int>(MaterialWrist)),
|
||||
luabind::value("Hands", static_cast<int>(MaterialHands)),
|
||||
luabind::value("Legs", static_cast<int>(MaterialLegs)),
|
||||
luabind::value("Feet", static_cast<int>(MaterialFeet)),
|
||||
luabind::value("Primary", static_cast<int>(MaterialPrimary)),
|
||||
luabind::value("Secondary", static_cast<int>(MaterialSecondary)),
|
||||
luabind::value("Max", static_cast<int>(_MaterialCount)), // deprecated
|
||||
luabind::value("Count", static_cast<int>(_MaterialCount)),
|
||||
luabind::value("Invalid", static_cast<int>(_MaterialInvalid))
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -72,7 +72,7 @@ Mob::Mob(const char* in_name,
|
||||
uint32 in_drakkin_heritage,
|
||||
uint32 in_drakkin_tattoo,
|
||||
uint32 in_drakkin_details,
|
||||
uint32 in_armor_tint[MAX_MATERIALS],
|
||||
uint32 in_armor_tint[_MaterialCount],
|
||||
|
||||
uint8 in_aa_title,
|
||||
uint8 in_see_invis, // see through invis/ivu
|
||||
@@ -238,7 +238,7 @@ Mob::Mob(const char* in_name,
|
||||
SkillProcs[j].base_spellID = SPELL_UNKNOWN;
|
||||
}
|
||||
|
||||
for (i = 0; i < MAX_MATERIALS; i++)
|
||||
for (i = 0; i < _MaterialCount; i++)
|
||||
{
|
||||
if (in_armor_tint)
|
||||
{
|
||||
@@ -945,7 +945,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
||||
|
||||
strn0cpy(ns->spawn.lastName, lastname, sizeof(ns->spawn.lastName));
|
||||
|
||||
for(i = 0; i < MAX_MATERIALS; i++)
|
||||
for(i = 0; i < _MaterialCount; i++)
|
||||
{
|
||||
ns->spawn.equipment[i] = GetEquipmentMaterial(i);
|
||||
if (armor_tint[i])
|
||||
@@ -2556,8 +2556,8 @@ int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
|
||||
{
|
||||
if // for primary and secondary we need the model, not the material
|
||||
(
|
||||
material_slot == MATERIAL_PRIMARY ||
|
||||
material_slot == MATERIAL_SECONDARY
|
||||
material_slot == MaterialPrimary ||
|
||||
material_slot == MaterialSecondary
|
||||
)
|
||||
{
|
||||
if(strlen(item->IDFile) > 2)
|
||||
|
||||
+3
-3
@@ -84,7 +84,7 @@ public:
|
||||
uint32 in_drakkin_heritage,
|
||||
uint32 in_drakkin_tattoo,
|
||||
uint32 in_drakkin_details,
|
||||
uint32 in_armor_tint[MAX_MATERIALS],
|
||||
uint32 in_armor_tint[_MaterialCount],
|
||||
uint8 in_aa_title,
|
||||
uint8 in_see_invis, // see through invis
|
||||
uint8 in_see_invis_undead, // see through invis vs. undead
|
||||
@@ -289,7 +289,7 @@ public:
|
||||
inline uint8 GetDrakkinHeritage() const { return drakkin_heritage; }
|
||||
inline uint8 GetDrakkinTattoo() const { return drakkin_tattoo; }
|
||||
inline uint8 GetDrakkinDetails() const { return drakkin_details; }
|
||||
inline uint32 GetArmorTint(uint8 i) const { return armor_tint[(i < MAX_MATERIALS) ? i : 0]; }
|
||||
inline uint32 GetArmorTint(uint8 i) const { return armor_tint[(i < _MaterialCount) ? i : 0]; }
|
||||
inline uint8 GetClass() const { return class_; }
|
||||
inline uint8 GetLevel() const { return level; }
|
||||
inline const char* GetName() const { return name; }
|
||||
@@ -1022,7 +1022,7 @@ protected:
|
||||
uint32 drakkin_heritage;
|
||||
uint32 drakkin_tattoo;
|
||||
uint32 drakkin_details;
|
||||
uint32 armor_tint[MAX_MATERIALS];
|
||||
uint32 armor_tint[_MaterialCount];
|
||||
|
||||
uint8 aa_title;
|
||||
|
||||
|
||||
+5
-5
@@ -1198,7 +1198,7 @@ uint32 ZoneDatabase::NPCSpawnDB(uint8 command, const char* zone, uint32 zone_ver
|
||||
|
||||
int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
|
||||
{
|
||||
if (material_slot >= MAX_MATERIALS)
|
||||
if (material_slot >= _MaterialCount)
|
||||
return 0;
|
||||
|
||||
int inv_slot = Inventory::CalcSlotFromMaterial(material_slot);
|
||||
@@ -1206,13 +1206,13 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
|
||||
return 0;
|
||||
if(equipment[inv_slot] == 0) {
|
||||
switch(material_slot) {
|
||||
case MATERIAL_HEAD:
|
||||
case MaterialHead:
|
||||
return helmtexture;
|
||||
case MATERIAL_CHEST:
|
||||
case MaterialChest:
|
||||
return texture;
|
||||
case MATERIAL_PRIMARY:
|
||||
case MaterialPrimary:
|
||||
return d_meele_texture1;
|
||||
case MATERIAL_SECONDARY:
|
||||
case MaterialSecondary:
|
||||
return d_meele_texture2;
|
||||
default:
|
||||
//they have nothing in the slot, and its not a special slot... they get nothing.
|
||||
|
||||
+4
-4
@@ -1197,7 +1197,7 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) {
|
||||
{
|
||||
if ((at_row = mysql_fetch_row(at_result)))
|
||||
{
|
||||
for (i = 0; i < MAX_MATERIALS; i++)
|
||||
for (i = 0; i < _MaterialCount; i++)
|
||||
{
|
||||
tmpNPCType->armor_tint[i] = atoi(at_row[i * 3]) << 16;
|
||||
tmpNPCType->armor_tint[i] |= atoi(at_row[i * 3 + 1]) << 8;
|
||||
@@ -1230,7 +1230,7 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) {
|
||||
|
||||
if (armor_tint_id == 0)
|
||||
{
|
||||
for (i = 1; i < MAX_MATERIALS; i++)
|
||||
for (i = 1; i < _MaterialCount; i++)
|
||||
{
|
||||
tmpNPCType->armor_tint[i] = tmpNPCType->armor_tint[0];
|
||||
}
|
||||
@@ -1508,7 +1508,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
|
||||
{
|
||||
if ((at_row = mysql_fetch_row(at_result)))
|
||||
{
|
||||
for (i = 0; i < MAX_MATERIALS; i++)
|
||||
for (i = 0; i < _MaterialCount; i++)
|
||||
{
|
||||
tmpNPCType->armor_tint[i] = atoi(at_row[i * 3]) << 16;
|
||||
tmpNPCType->armor_tint[i] |= atoi(at_row[i * 3 + 1]) << 8;
|
||||
@@ -1541,7 +1541,7 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client
|
||||
|
||||
if (armor_tint_id == 0)
|
||||
{
|
||||
for (i = 1; i < MAX_MATERIALS; i++)
|
||||
for (i = 1; i < _MaterialCount; i++)
|
||||
{
|
||||
tmpNPCType->armor_tint[i] = tmpNPCType->armor_tint[0];
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ struct NPCType
|
||||
uint32 drakkin_heritage;
|
||||
uint32 drakkin_tattoo;
|
||||
uint32 drakkin_details;
|
||||
uint32 armor_tint[MAX_MATERIALS];
|
||||
uint32 armor_tint[_MaterialCount];
|
||||
uint32 min_dmg;
|
||||
uint32 max_dmg;
|
||||
int16 attack_count;
|
||||
|
||||
Reference in New Issue
Block a user