Merge remote-tracking branch 'remotes/origin/master' into web_interface

Conflicts:
	common/shareddb.cpp
	zone/corpse.cpp
	zone/worldserver.cpp
	zone/zone.cpp
This commit is contained in:
Akkadius
2014-12-15 20:15:16 -06:00
125 changed files with 1277 additions and 985 deletions
-1
View File
@@ -19,7 +19,6 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
#include "../common/classes.h"
#include "../common/debug.h"
#include "../common/eq_packet_structs.h"
#include "../common/packet_dump.h"
#include "../common/races.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
+2
View File
@@ -5,6 +5,7 @@
struct AA_Ability;
struct SendAA_Struct;
#define MANA_BURN 664
#include <map>
@@ -2155,6 +2156,7 @@ enum { //values of AA_Action.action
};
class Timer;
class Mob;
class AA_SwarmPetInfo {
public:
AA_SwarmPetInfo();
+4
View File
@@ -39,6 +39,10 @@
#include <stdio.h>
#include <stdlib.h>
#ifdef BOTS
#include "bot.h"
#endif
extern QueryServ* QServ;
extern WorldServer worldserver;
+12 -2
View File
@@ -23,7 +23,7 @@ target to center around.
*/
#include "../common/debug.h"
class Zone;
#ifdef _WINDOWS
#define snprintf _snprintf
@@ -32,7 +32,17 @@ target to center around.
#define strcasecmp _stricmp
#endif
#include "masterentity.h"
#include "../common/races.h"
#include "beacon.h"
#include "entity.h"
#include "mob.h"
#ifdef BOTS
#include "bot.h"
#endif
#include "../common/spdat.h"
extern EntityList entity_list;
+4 -1
View File
@@ -19,11 +19,14 @@
#ifndef BEACON_H
#define BEACON_H
#include "entity.h"
#include "mob.h"
#include "../common/types.h"
#include "../common/timer.h"
class Group;
class Raid;
struct ExtraAttackOptions;
class Beacon : public Mob
{
public:
+15 -13
View File
@@ -15,27 +15,29 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/spdat.h"
#include "masterentity.h"
#include "../common/packet_dump.h"
#include "../common/moremath.h"
#include "../common/item.h"
#include "worldserver.h"
#include "../common/skills.h"
#include "../common/bodytypes.h"
#include "../common/classes.h"
#include "../common/debug.h"
#include "../common/item.h"
#include "../common/rulesys.h"
#include "../common/skills.h"
#include "../common/spdat.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#ifdef BOTS
#include "bot.h"
#endif
#include "quest_parser_collection.h"
#include <math.h>
#include <assert.h>
#include <iostream>
#ifndef WIN32
#include <stdlib.h>
#include "../common/unix.h"
#endif
#include "string_ids.h"
void Mob::CalcBonuses()
{
+34 -4
View File
@@ -4173,7 +4173,7 @@ void Bot::SetBotItemInSlot(uint32 slotID, uint32 itemID, const ItemInst* inst, s
"augslot1, augslot2, augslot3, augslot4, augslot5) "
"VALUES(%lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu, %lu)",
(unsigned long)this->GetBotID(), (unsigned long)slotID, (unsigned long)itemID,
(unsigned long)inst->GetCharges(), (unsigned long)(inst->IsInstNoDrop()? 1: 0),
(unsigned long)inst->GetCharges(), (unsigned long)(inst->IsAttuned()? 1: 0),
(unsigned long)inst->GetColor(), (unsigned long)augslot[0], (unsigned long)augslot[1],
(unsigned long)augslot[2], (unsigned long)augslot[3], (unsigned long)augslot[4]);
auto results = database.QueryDatabase(query);
@@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) {
int16 put_slot_id = INVALID_INDEX;
if (instnodrop || ((slot_id >= EmuConstants::EQUIPMENT_BEGIN) && (slot_id <= EmuConstants::EQUIPMENT_END) && inst->GetItem()->Attuneable))
inst->SetInstNoDrop(true);
inst->SetAttuned(true);
if (color > 0)
inst->SetColor(color);
@@ -4390,7 +4390,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
uint32 spawnedbotid = 0;
spawnedbotid = this->GetBotID();
for (int i = 0; i < _MaterialCount; i++)
for (int i = 0; i < MaterialPrimary; i++)
{
inst = GetBotItem(i);
if (inst)
@@ -4420,6 +4420,34 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
}
}
}
inst = GetBotItem(MainPrimary);
if(inst)
{
item = inst->GetItem();
if(item)
{
if(strlen(item->IDFile) > 2)
{
ns->spawn.equipment[MaterialPrimary].material = atoi(&item->IDFile[2]);
}
ns->spawn.colors[MaterialPrimary].color = GetEquipmentColor(MaterialPrimary);
}
}
inst = GetBotItem(MainSecondary);
if(inst)
{
item = inst->GetItem();
if(item)
{
if(strlen(item->IDFile) > 2)
{
ns->spawn.equipment[MaterialSecondary].material = atoi(&item->IDFile[2]);
}
ns->spawn.colors[MaterialSecondary].color = GetEquipmentColor(MaterialSecondary);
}
}
}
}
@@ -16007,11 +16035,13 @@ uint8 Bot::GetNumberNeedingHealedInGroup(uint8 hpr, bool includePets) {
uint32 Bot::GetEquipmentColor(uint8 material_slot) const
{
//Bot tints
uint32 slotid = 0;
int16 slotid = 0;
uint32 botid = this->GetBotID();
//Translate code slot # to DB slot #
slotid = Inventory::CalcSlotFromMaterial(material_slot);
if (slotid == INVALID_INDEX)
return 0;
//read from db
std::string query = StringFormat("SELECT color FROM botinventory "
+39 -162
View File
@@ -1819,129 +1819,43 @@ void Client::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
ns->spawn.runspeed = (gmspeed == 0) ? runspeed : 3.125f;
if (!m_pp.showhelm) ns->spawn.showhelm = 0;
// pp also hold this info; should we pull from there or inventory?
// (update: i think pp should do it, as this holds LoY dye - plus, this is ugly code with Inventory!)
/*
// Equipment/Weapons already set from Mob::FillSpawnStruct
// Commenting this out for now
const Item_Struct* item = nullptr;
const ItemInst* inst = nullptr;
int16 invslot;
// Only Player Races Wear Armor
if (IsPlayerRace(race))
for (uint32 matslot = 0; matslot < _MaterialCount; matslot++)
{
if ((inst = m_inv[MainHands]) && inst->IsType(ItemClassCommon))
// Only Player Races Wear Armor
if (IsPlayerRace(race) || matslot > 6)
{
item = inst->GetItem();
ns->spawn.equipment[MaterialHands].material = item->Material;
ns->spawn.equipment[MaterialHands].elitematerial = item->EliteMaterial;
ns->spawn.equipment[MaterialHands].heroforgemodel = item->HerosForgeModel;
ns->spawn.colors[MaterialHands].color = m_pp.item_tint[MaterialHands].rgb.use_tint ? m_pp.item_tint[MaterialHands].color : item->Color;
}
if ((inst = m_inv[MainHead]) && inst->IsType(ItemClassCommon))
{
item = inst->GetItem();
ns->spawn.equipment[MaterialHead].material = item->Material;
ns->spawn.equipment[MaterialHead].elitematerial = item->EliteMaterial;
ns->spawn.equipment[MaterialHead].heroforgemodel = item->HerosForgeModel;
ns->spawn.colors[MaterialHead].color = m_pp.item_tint[MaterialHead].rgb.use_tint ? m_pp.item_tint[MaterialHead].color : item->Color;
}
if ((inst = m_inv[MainArms]) && inst->IsType(ItemClassCommon))
{
item = inst->GetItem();
ns->spawn.equipment[MaterialArms].material = item->Material;
ns->spawn.equipment[MaterialArms].elitematerial = item->EliteMaterial;
ns->spawn.equipment[MaterialArms].heroforgemodel = item->HerosForgeModel;
ns->spawn.colors[MaterialArms].color = m_pp.item_tint[MaterialArms].rgb.use_tint ? m_pp.item_tint[MaterialArms].color : item->Color;
}
if ((inst = m_inv[MainWrist1]) && inst->IsType(ItemClassCommon))
{
item = inst->GetItem();
ns->spawn.equipment[MaterialWrist].material = item->Material;
ns->spawn.equipment[MaterialWrist].elitematerial = item->EliteMaterial;
ns->spawn.equipment[MaterialWrist].heroforgemodel = item->HerosForgeModel;
ns->spawn.colors[MaterialWrist].color = m_pp.item_tint[MaterialWrist].rgb.use_tint ? m_pp.item_tint[MaterialWrist].color : item->Color;
}
invslot = Inventory::CalcSlotFromMaterial(matslot);
if (invslot == INVALID_INDEX)
continue;
if ((inst = m_inv[MainChest]) && inst->IsType(ItemClassCommon))
{
item = inst->GetItem();
ns->spawn.equipment[MaterialChest].material = item->Material;
ns->spawn.equipment[MaterialChest].elitematerial = item->EliteMaterial;
ns->spawn.equipment[MaterialChest].heroforgemodel = item->HerosForgeModel;
ns->spawn.colors[MaterialChest].color = m_pp.item_tint[MaterialChest].rgb.use_tint ? m_pp.item_tint[MaterialChest].color : item->Color;
}
if ((inst = m_inv[MainLegs]) && inst->IsType(ItemClassCommon))
{
item = inst->GetItem();
ns->spawn.equipment[MaterialLegs].material = item->Material;
ns->spawn.equipment[MaterialLegs].elitematerial = item->EliteMaterial;
ns->spawn.equipment[MaterialLegs].heroforgemodel = item->HerosForgeModel;
ns->spawn.colors[MaterialLegs].color = m_pp.item_tint[MaterialLegs].rgb.use_tint ? m_pp.item_tint[MaterialLegs].color : item->Color;
}
if ((inst = m_inv[MainFeet]) && inst->IsType(ItemClassCommon))
{
item = inst->GetItem();
ns->spawn.equipment[MaterialFeet].material = item->Material;
ns->spawn.equipment[MaterialFeet].elitematerial = item->EliteMaterial;
ns->spawn.equipment[MaterialFeet].heroforgemodel = item->HerosForgeModel;
ns->spawn.colors[MaterialFeet].color = m_pp.item_tint[MaterialFeet].rgb.use_tint ? m_pp.item_tint[MaterialFeet].color : item->Color;
}
}
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
if ((inst = m_inv[MainPrimary]) && inst->IsType(ItemClassCommon))
{
if (inst->GetOrnamentationAug(ornamentationAugtype))
{
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
if (strlen(item->IDFile) > 2)
if ((inst = m_inv[invslot]) && inst->IsType(ItemClassCommon))
{
ns->spawn.equipment[MaterialPrimary].material = atoi(&item->IDFile[2]);
}
}
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile())
{
ns->spawn.equipment[MaterialPrimary].material = inst->GetOrnamentationIDFile();
}
else
{
item = inst->GetItem();
if (strlen(item->IDFile) > 2)
{
ns->spawn.equipment[MaterialPrimary].material = atoi(&item->IDFile[2]);
item = inst->GetItem();
if (matslot > 6)
{
// Weapon Models
ns->spawn.equipment[matslot].material = GetEquipmentMaterial(matslot);
}
else
{
// Armor Materials/Models
ns->spawn.equipment[matslot].material = item->Material;
ns->spawn.equipment[matslot].elitematerial = item->EliteMaterial;
ns->spawn.equipment[matslot].heroforgemodel = GetHerosForgeModel(matslot);
ns->spawn.colors[matslot].color = m_pp.item_tint[matslot].rgb.use_tint ? m_pp.item_tint[matslot].color : item->Color;
}
}
}
}
if ((inst = m_inv[MainSecondary]) && inst->IsType(ItemClassCommon))
{
if (inst->GetOrnamentationAug(ornamentationAugtype))
{
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
if (strlen(item->IDFile) > 2)
{
ns->spawn.equipment[MaterialSecondary].material = atoi(&item->IDFile[2]);
}
}
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile())
{
ns->spawn.equipment[MaterialSecondary].material = inst->GetOrnamentationIDFile();
}
else
{
item = inst->GetItem();
if (strlen(item->IDFile) > 2)
{
ns->spawn.equipment[MaterialSecondary].material = atoi(&item->IDFile[2]);
}
}
}
//these two may be related to ns->spawn.texture
/*
ns->spawn.npc_armor_graphic = texture;
ns->spawn.npc_helm_graphic = helmtexture;
*/
//filling in some unknowns to make the client happy
// ns->spawn.unknown0002[2] = 3;
}
bool Client::GMHideMe(Client* client) {
@@ -2769,48 +2683,10 @@ bool Client::BindWound(Mob* bindmob, bool start, bool fail){
void Client::SetMaterial(int16 in_slot, uint32 item_id) {
const Item_Struct* item = database.GetItem(item_id);
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
if (item && (item->ItemClass==ItemClassCommon)) {
if (in_slot==MainHead)
m_pp.item_material[MaterialHead] = item->Material;
else if (in_slot==MainChest)
m_pp.item_material[MaterialChest] = item->Material;
else if (in_slot==MainArms)
m_pp.item_material[MaterialArms] = item->Material;
else if (in_slot==MainWrist1)
m_pp.item_material[MaterialWrist] = item->Material;
else if (in_slot==MainHands)
m_pp.item_material[MaterialHands] = item->Material;
else if (in_slot==MainLegs)
m_pp.item_material[MaterialLegs] = item->Material;
else if (in_slot==MainFeet)
m_pp.item_material[MaterialFeet] = item->Material;
else if (in_slot == MainPrimary) {
const ItemInst* inst = m_inv[MainPrimary];
if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) {
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
m_pp.item_material[MaterialPrimary] = atoi(item->IDFile + 2);
}
else if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
m_pp.item_material[MaterialPrimary] = inst->GetOrnamentationIDFile();
}
else {
m_pp.item_material[MaterialPrimary] = atoi(item->IDFile + 2);
}
}
else if (in_slot == MainSecondary) {
const ItemInst* inst = m_inv[MainSecondary];
if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) {
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
m_pp.item_material[MaterialSecondary] = atoi(item->IDFile + 2);
}
else if (inst && inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
m_pp.item_material[MaterialSecondary] = inst->GetOrnamentationIDFile();
}
else {
m_pp.item_material[MaterialSecondary] = atoi(item->IDFile + 2);
}
}
if (item && (item->ItemClass==ItemClassCommon))
{
uint32 matslot = Inventory::CalcMaterialFromSlot(in_slot);
m_pp.item_material[matslot] = GetEquipmentMaterial(matslot);
}
}
@@ -5859,17 +5735,18 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
if(inst) {
item = inst->GetItem();
if(item) {
if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) {
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
strcpy(insr->itemnames[L], item->Name);
insr->itemicons[L] = aug_weap->Icon;
strcpy(insr->itemnames[L], item->Name);
if (inst && inst->GetOrnamentationAug(ornamentationAugtype))
{
const Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
insr->itemicons[L] = aug_item->Icon;
}
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
strcpy(insr->itemnames[L], item->Name);
else if (inst && inst->GetOrnamentationIcon())
{
insr->itemicons[L] = inst->GetOrnamentationIcon();
}
else {
strcpy(insr->itemnames[L], item->Name);
else
{
insr->itemicons[L] = item->Icon;
}
}
+17 -12
View File
@@ -17,7 +17,17 @@
*/
#ifndef CLIENT_H
#define CLIENT_H
class Client;
class EQApplicationPacket;
class EQStream;
class Group;
class NPC;
class Object;
class Raid;
class Seperator;
class ServerPacket;
struct Item_Struct;
#include "../common/timer.h"
#include "../common/ptimer.h"
@@ -28,25 +38,21 @@ class Client;
#include "../common/eq_packet.h"
#include "../common/linked_list.h"
#include "../common/extprofile.h"
#include "../common/classes.h"
#include "../common/races.h"
#include "../common/deity.h"
#include "../common/seperator.h"
#include "../common/item.h"
#include "../common/guilds.h"
#include "../common/item_struct.h"
#include "../common/clientversions.h"
#include "common.h"
#include "zonedb.h"
#include "errno.h"
#include "mob.h"
#include "npc.h"
#include "merc.h"
#include "zone.h"
#include "aa.h"
#include "questmgr.h"
#include "common.h"
#include "merc.h"
#include "mob.h"
#include "qglobals.h"
#include "questmgr.h"
#include "zone.h"
#include "zonedb.h"
#ifdef _WINDOWS
// since windows defines these within windef.h (which windows.h include)
@@ -57,7 +63,6 @@ class Client;
#include <float.h>
#include <set>
#include <string>
#include <algorithm>
@@ -805,7 +810,7 @@ public:
void QSSwapItemAuditor(MoveItem_Struct* move_in, bool postaction_call = false);
void PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data = 0);
bool AutoPutLootInInventory(ItemInst& inst, bool try_worn = false, bool try_cursor = true, ServerLootItem_Struct** bag_item_data = 0);
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0);
bool SummonItem(uint32 item_id, int16 charges = -1, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, bool attuned = false, uint16 to_slot = MainCursor, uint32 ornament_icon = 0, uint32 ornament_idfile = 0, uint32 ornament_hero_model = 0);
void SetStats(uint8 type,int16 set_val);
void IncStats(uint8 type,int16 increase_val);
void DropItem(int16 slot_id);
+1 -1
View File
@@ -18,11 +18,11 @@
#ifndef CLIENT_LOGS_H
#define CLIENT_LOGS_H
#include "../common/debug.h"
#include "../common/features.h"
#ifdef CLIENT_LOGS
#include "../common/eq_packet_structs.h"
#define CLIENT_LOG_CHANNEL MT_Chat10Echo
+10 -8
View File
@@ -15,18 +15,20 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <algorithm>
#include "../common/debug.h"
#include "../common/logsys.h"
#include "../common/spdat.h"
#include "../common/rulesys.h"
#include "masterentity.h"
#include "npc_ai.h"
#include "petitions.h"
#include "string_ids.h"
#include "worldserver.h"
#include "zonedb.h"
#include "../common/spdat.h"
#include "client.h"
#include "mob.h"
#ifdef BOTS
#include "bot.h"
#endif
#include <algorithm>
int32 Client::GetMaxStat() const {
+40 -16
View File
@@ -61,6 +61,10 @@
#include "remote_call.h"
#include "remote_call_subscribe.h"
#ifdef BOTS
#include "bot.h"
#endif
extern QueryServ* QServ;
extern Zone* zone;
extern volatile bool ZoneLoaded;
@@ -1486,9 +1490,28 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app)
m_pp.gm = 0;
/* Load Guild */
if (!IsInAGuild()) { m_pp.guild_id = GUILD_NONE; }
else {
if (!IsInAGuild()) {
m_pp.guild_id = GUILD_NONE;
} else {
m_pp.guild_id = GuildID();
uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID());
// FIXME: RoF guild rank
if (GetClientVersion() >= EQClientRoF) {
switch (rank) {
case 0:
rank = 5;
break;
case 1:
rank = 3;
break;
case 2:
rank = 1;
break;
default:
break;
}
}
m_pp.guildrank = rank;
if (zone->GetZoneID() == RuleI(World, GuildBankZoneID))
GuildBanker = (guild_mgr.IsGuildLeader(GuildID(), CharacterID()) || guild_mgr.GetBankerFlag(CharacterID()));
}
@@ -2726,7 +2749,7 @@ void Client::Handle_OP_AltCurrencyReclaim(const EQApplicationPacket *app)
SetAlternateCurrencyValue(reclaim->currency_id, 0);
}
else {
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, false, MainCursor);
SummonItem(item_id, reclaim->count, 0, 0, 0, 0, 0, 0, false, MainCursor);
AddAlternateCurrencyValue(reclaim->currency_id, -((int32)reclaim->count));
}
/* QS: PlayerLogAlternateCurrencyTransactions :: Cursor to Item Storage */
@@ -3069,7 +3092,6 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
uint16 slot_id = in_augment->container_slot;
uint16 aug_slot_id = in_augment->augment_slot;
//Message(13, "%i AugSlot", aug_slot_id);
if (slot_id == INVALID_INDEX || aug_slot_id == INVALID_INDEX)
{
Message(13, "Error: Invalid Aug Index.");
@@ -3085,6 +3107,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
(tobe_auged->AvailableWearSlot(auged_with->GetItem()->Slots)))
{
tobe_auged->PutAugment(in_augment->augment_index, *auged_with);
tobe_auged->UpdateOrnamentationInfo();
ItemInst *aug = tobe_auged->GetAugment(in_augment->augment_index);
if (aug) {
@@ -3107,15 +3130,16 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
{
DeleteItemInInventory(slot_id, 0, true);
DeleteItemInInventory(MainCursor, 0, true);
if (PutItemInInventory(slot_id, *itemOneToPush, true))
{
CalcBonuses();
//Message(13, "Sucessfully added an augment to your item!");
// Successfully added an augment to the item
return;
}
else
{
Message(13, "Error: No available slot for end result. Please free up some bag space.");
Message(13, "Error: No available slot for end result. Please free up the augment slot.");
}
}
else
@@ -3169,6 +3193,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
return;
}
old_aug = tobe_auged->RemoveAugment(in_augment->augment_index);
tobe_auged->UpdateOrnamentationInfo();
itemOneToPush = tobe_auged->Clone();
if (old_aug)
@@ -3177,9 +3202,10 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app)
{
DeleteItemInInventory(slot_id, 0, true);
DeleteItemInInventory(aug_slot_id, auged_with->IsStackable() ? 1 : 0, true);
if (!PutItemInInventory(slot_id, *itemOneToPush, true))
{
Message(15, "Shouldn't happen, contact an admin!");
Message(15, "Failed to remove augment properly!");
}
if (PutItemInInventory(MainCursor, *itemTwoToPush, true))
@@ -6977,7 +7003,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
const Item_Struct* CursorItem = CursorItemInst->GetItem();
if (!CursorItem->NoDrop || CursorItemInst->IsInstNoDrop())
if (!CursorItem->NoDrop || CursorItemInst->IsAttuned())
{
Message_StringID(13, GUILD_BANK_CANNOT_DEPOSIT);
@@ -8043,17 +8069,15 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app)
item = inst ? inst->GetItem() : nullptr;
if (item) {
strcpy(insr->itemnames[L], item->Name);
if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) {
const Item_Struct *aug_weap = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
strcpy(insr->itemnames[L], item->Name);
insr->itemicons[L] = aug_weap->Icon;
const Item_Struct *aug_item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
insr->itemicons[L] = aug_item->Icon;
}
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
strcpy(insr->itemnames[L], item->Name);
else if (inst->GetOrnamentationIcon()) {
insr->itemicons[L] = inst->GetOrnamentationIcon();
}
else {
strcpy(insr->itemnames[L], item->Name);
insr->itemicons[L] = item->Icon;
}
}
@@ -8224,7 +8248,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app)
}
ItemInst* inst = database.CreateItem(item, item->MaxCharges, ivrs->augments[0], ivrs->augments[1], ivrs->augments[2], ivrs->augments[3], ivrs->augments[4]);
ItemInst* inst = database.CreateItem(item, item->MaxCharges, ivrs->augments[0], ivrs->augments[1], ivrs->augments[2], ivrs->augments[3], ivrs->augments[4], ivrs->augments[5]);
if (inst) {
SendItemPacket(0, inst, ItemPacketViewLink);
safe_delete(inst);
@@ -8380,7 +8404,7 @@ void Client::Handle_OP_ItemPreview(const EQApplicationPacket *app)
}
outapp->WriteUInt32(0xFFFFFFFF); //Unknown but always seen as FF FF FF FF
outapp->WriteUInt32(0); //Unknown
for (spacer = 0; spacer < 5; spacer++) { //Augment stuff
for (spacer = 0; spacer < 6; spacer++) { //Augment stuff
outapp->WriteUInt32(item->AugSlotType[spacer]);
outapp->WriteUInt8(item->AugSlotVisible[spacer]);
outapp->WriteUInt8(item->AugSlotUnk2[spacer]);
+65 -18
View File
@@ -153,6 +153,8 @@ int command_init(void) {
command_add("version","- Display current version of EQEmu server",0,command_version) ||
command_add("setfaction","[faction number] - Sets targeted NPC's faction in the database",170,command_setfaction) ||
command_add("wc","[wear slot] [material] - Sends an OP_WearChange for your target",200,command_wc) ||
command_add("heromodel", "[hero model] [slot] - Full set of Hero's Forge Armor appearance. If slot is set, sends exact model just to slot.", 200, command_heromodel) ||
command_add("hm", "[hero model] [slot] - Full set of Hero's Forge Armor appearance. If slot is set, sends exact model just to slot.)", 200, command_heromodel) ||
command_add("setanim","[animnum] - Set target's appearance to animnum",200,command_setanim) ||
command_add("connectworldserver","- Make zone attempt to connect to worldserver",200,command_connectworldserver) ||
command_add("connectworld",nullptr,0,command_connectworldserver) ||
@@ -787,6 +789,47 @@ void command_wc(Client *c, const Seperator *sep)
}
}
void command_heromodel(Client *c, const Seperator *sep)
{
if (sep->argnum < 1)
{
c->Message(0, "Usage: #heromodel [hero forge model] [ [slot] ] (example: #heromodel 63)");
}
else if (c->GetTarget() == nullptr)
{
c->Message(13, "You must have a target to do a wear change for Hero's Forge Models.");
}
else
{
uint32 hero_forge_model = atoi(sep->arg[1]);
if (sep->argnum > 1)
{
uint8 wearslot = (uint8)atoi(sep->arg[2]);
c->GetTarget()->SendTextureWC(wearslot, 0, hero_forge_model, 0, 0, 0);
}
else
{
if (hero_forge_model > 0)
{
// Conversion to simplify the command arguments
// Hero's Forge model is actually model * 1000 + texture * 100 + wearslot
// Hero's Forge Model slot 7 is actually for Robes, but it still needs to use wearslot 1 in the packet
hero_forge_model *= 100;
for (uint8 wearslot = 0; wearslot < 7; wearslot++)
{
c->GetTarget()->SendTextureWC(wearslot, 0, (hero_forge_model + wearslot), 0, 0, 0);
}
}
else
{
c->Message(13, "Hero's Forge Model must be greater than 0.");
}
}
}
}
void command_setanim(Client *c, const Seperator *sep)
{
if (c->GetTarget() && sep->IsNumber(1)) {
@@ -5513,18 +5556,20 @@ void command_summonitem(Client *c, const Seperator *sep)
if (item_status > c->Admin())
c->Message(13, "Error: Insufficient status to summon this item.");
else if (sep->argnum==2 && sep->IsNumber(2)) {
c->SummonItem(itemid, atoi(sep->arg[2]) );
} else if (sep->argnum==3) {
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]) );
} else if (sep->argnum==4)
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]) );
else if (sep->argnum==2 && sep->IsNumber(2))
c->SummonItem(itemid, atoi(sep->arg[2]));
else if (sep->argnum==3)
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]));
else if (sep->argnum==4)
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]));
else if (sep->argnum==5)
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]) );
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]));
else if (sep->argnum==6)
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]) );
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]));
else if (sep->argnum==7)
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]) );
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]));
else if (sep->argnum==8)
c->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]), atoi(sep->arg[8]));
else {
c->SummonItem(itemid);
}
@@ -5550,18 +5595,20 @@ void command_giveitem(Client *c, const Seperator *sep)
if (item_status > c->Admin())
c->Message(13, "Error: Insufficient status to summon this item.");
else if (sep->argnum==2 && sep->IsNumber(2)) {
t->SummonItem(itemid, atoi(sep->arg[2]) );
} else if (sep->argnum==3) {
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]) );
} else if (sep->argnum==4)
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]) );
else if (sep->argnum==2 && sep->IsNumber(2))
t->SummonItem(itemid, atoi(sep->arg[2]));
else if (sep->argnum==3)
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]));
else if (sep->argnum==4)
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]));
else if (sep->argnum==5)
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]) );
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]));
else if (sep->argnum==6)
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]) );
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]));
else if (sep->argnum==7)
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]) );
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]));
else if (sep->argnum == 7)
t->SummonItem(itemid, atoi(sep->arg[2]), atoi(sep->arg[3]), atoi(sep->arg[4]), atoi(sep->arg[5]), atoi(sep->arg[6]), atoi(sep->arg[7]), atoi(sep->arg[8]));
else {
t->SummonItem(itemid);
}
+1
View File
@@ -76,6 +76,7 @@ void command_serversidename(Client *c, const Seperator *sep);
void command_testspawnkill(Client *c, const Seperator *sep);
void command_testspawn(Client *c, const Seperator *sep);
void command_wc(Client *c, const Seperator *sep);
void command_heromodel(Client *c, const Seperator *sep);
void command_numauths(Client *c, const Seperator *sep);
void command_setanim(Client *c, const Seperator *sep);
void command_connectworldserver(Client *c, const Seperator *sep);
+2 -2
View File
@@ -134,8 +134,8 @@ enum {
DISABLE_MELEE = 39,
NPC_CHASE_DISTANCE = 40,
ALLOW_TO_TANK = 41,
MAX_SPECIAL_ATTACK = 42
IGNORE_ROOT_AGGRO_RULES = 42,
MAX_SPECIAL_ATTACK = 43
};
typedef enum { //fear states
+25 -17
View File
@@ -20,12 +20,7 @@ New class for handeling corpses and everything associated with them.
Child of the Mob class.
-Quagmire
*/
#include "../common/debug.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <sstream>
#ifdef _WINDOWS
#define snprintf _snprintf
#define vsnprintf _vsnprintf
@@ -33,14 +28,25 @@ Child of the Mob class.
#define strcasecmp _stricmp
#endif
#include "masterentity.h"
#include "../common/packet_functions.h"
#include "../common/debug.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/crc32.h"
#include "client.h"
#include "corpse.h"
#include "entity.h"
#include "groups.h"
#include "mob.h"
#include "raids.h"
#ifdef BOTS
#include "bot.h"
#endif
#include "quest_parser_collection.h"
#include "string_ids.h"
#include "worldserver.h"
#include "../common/rulesys.h"
#include "quest_parser_collection.h"
#include <iostream>
#include "remote_call_subscribe.h"
@@ -446,7 +452,7 @@ std::list<uint32> Corpse::MoveItemToCorpse(Client *client, ItemInst *item, int16
ItemInst *interior_item;
std::list<uint32> returnlist;
AddItem(item->GetItem()->ID, item->GetCharges(), equipslot, item->GetAugmentItemID(0), item->GetAugmentItemID(1), item->GetAugmentItemID(2), item->GetAugmentItemID(3), item->GetAugmentItemID(4));
AddItem(item->GetItem()->ID, item->GetCharges(), equipslot, item->GetAugmentItemID(0), item->GetAugmentItemID(1), item->GetAugmentItemID(2), item->GetAugmentItemID(3), item->GetAugmentItemID(4), item->GetAugmentItemID(5), item->IsAttuned());
returnlist.push_back(equipslot);
// Qualified bag slot iterations. processing bag slots that don't exist is probably not a good idea.
@@ -457,7 +463,7 @@ std::list<uint32> Corpse::MoveItemToCorpse(Client *client, ItemInst *item, int16
interior_item = client->GetInv().GetItem(interior_slot);
if (interior_item) {
AddItem(interior_item->GetItem()->ID, interior_item->GetCharges(), interior_slot, interior_item->GetAugmentItemID(0), interior_item->GetAugmentItemID(1), interior_item->GetAugmentItemID(2), interior_item->GetAugmentItemID(3), interior_item->GetAugmentItemID(4));
AddItem(interior_item->GetItem()->ID, interior_item->GetCharges(), interior_slot, interior_item->GetAugmentItemID(0), interior_item->GetAugmentItemID(1), interior_item->GetAugmentItemID(2), interior_item->GetAugmentItemID(3), interior_item->GetAugmentItemID(4), interior_item->GetAugmentItemID(5), item->IsAttuned());
returnlist.push_back(Inventory::CalcSlotId(equipslot, bagindex));
client->DeleteItemInInventory(interior_slot, 0, true, false);
}
@@ -689,7 +695,7 @@ uint32 Corpse::CountItems() {
return itemlist.size();
}
void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) {
void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, uint8 attuned) {
if (!database.GetItem(itemnum))
return;
@@ -706,6 +712,8 @@ void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, ui
item->aug_3=aug3;
item->aug_4=aug4;
item->aug_5=aug5;
item->aug_6=aug6;
item->attuned=attuned;
itemlist.push_back(item);
}
@@ -1049,7 +1057,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a
if(i < corpselootlimit) {
item = database.GetItem(item_data->item_id);
if(client && item) {
ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5);
ItemInst* inst = database.CreateItem(item, item_data->charges, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5, item_data->aug_6, item_data->attuned);
if(inst) {
// MainGeneral1 is the corpse inventory start offset for Ti(EMu) - CORPSE_END = MainGeneral1 + MainCursor
client->SendItemPacket(i + EmuConstants::CORPSE_BEGIN, inst, ItemPacketLoot);
@@ -1164,7 +1172,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) {
if (item != 0) {
if (item_data){
inst = database.CreateItem(item, item_data ? item_data->charges : 0, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5);
inst = database.CreateItem(item, item_data ? item_data->charges : 0, item_data->aug_1, item_data->aug_2, item_data->aug_3, item_data->aug_4, item_data->aug_5, item_data->aug_6, item_data->attuned);
}
else {
inst = database.CreateItem(item);
@@ -1436,7 +1444,7 @@ void Corpse::Spawn() {
}
uint32 Corpse::GetEquipment(uint8 material_slot) const {
int invslot;
int16 invslot;
if(material_slot > EmuConstants::MATERIAL_END) {
return NO_ITEM;
+8 -1
View File
@@ -22,7 +22,14 @@
#include "mob.h"
class Client;
class EQApplicationPacket;
class Group;
class ItemInst;
class NPC;
class Raid;
struct ExtraAttackOptions;
struct NPCType;
#define MAX_LOOTERS 72
@@ -79,7 +86,7 @@ class Corpse : public Mob {
int32 GetPlayerKillItem() { return player_kill_item; }
void RemoveItem(uint16 lootslot);
void RemoveItem(ServerLootItem_Struct* item_data);
void AddItem(uint32 itemnum, uint16 charges, int16 slot = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0);
void AddItem(uint32 itemnum, uint16 charges, int16 slot = 0, uint32 aug1 = 0, uint32 aug2 = 0, uint32 aug3 = 0, uint32 aug4 = 0, uint32 aug5 = 0, uint32 aug6 = 0, uint8 attuned = 0);
/* Corpse: Coin */
void SetCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum);
+12 -9
View File
@@ -15,18 +15,21 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include <iostream>
#include <stdlib.h>
#include <string.h>
#include "masterentity.h"
#include "worldserver.h"
#include "string_ids.h"
#include "zonedb.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/string_util.h"
#include "client.h"
#include "doors.h"
#include "entity.h"
#include "guild_mgr.h"
#include "mob.h"
#include "string_ids.h"
#include "worldserver.h"
#include "zonedb.h"
#include <iostream>
#include <string.h>
#define OPEN_DOOR 0x02
#define CLOSE_DOOR 0x03
+8 -4
View File
@@ -1,14 +1,18 @@
#ifndef DOORS_H
#define DOORS_H
#include "../common/types.h"
#include "../common/linked_list.h"
#include "../common/timer.h"
#include "../common/emu_opcodes.h"
#include "../common/eq_packet_structs.h"
#include "entity.h"
#include "../common/linked_list.h"
#include "mob.h"
#include "zonedump.h"
class Client;
class Mob;
class NPC;
struct Door;
class Doors : public Entity
{
public:
+8 -11
View File
@@ -15,20 +15,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "masterentity.h"
#include "../common/spdat.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#include "string_ids.h"
#include "worldserver.h"
#include "zonedb.h"
#include "../common/spdat.h"
#include "../common/packet_dump.h"
#include "../common/packet_functions.h"
#include "petitions.h"
#include "../common/serverinfo.h"
#include "../common/zone_numbers.h"
#include "../common/moremath.h"
#include "../common/guilds.h"
#include "string_ids.h"
#include "npc_ai.h"
float Mob::GetActSpellRange(uint16 spell_id, float range, bool IsBard)
{
+1 -1
View File
@@ -1146,7 +1146,7 @@ void PerlembParser::ExportEventVariables(std::string &package_name, QuestEventID
temp_var_name = var_name;
temp_var_name += "_attuned";
ExportVar(package_name.c_str(), temp_var_name.c_str(), inst->IsInstNoDrop());
ExportVar(package_name.c_str(), temp_var_name.c_str(), inst->IsAttuned());
} else {
ExportVar(package_name.c_str(), var_name.c_str(), 0);
+3 -2
View File
@@ -23,12 +23,13 @@
#include "../common/debug.h"
#include "../common/misc_functions.h"
#include "embparser.h"
#include "questmgr.h"
#include "embxs.h"
#include "entity.h"
#include "zone.h"
#include "queryserv.h"
#include "questmgr.h"
#include "zone.h"
extern Zone* zone;
extern QueryServ* QServ;
+5 -1
View File
@@ -32,7 +32,7 @@
#include "../common/features.h"
#include "../common/guilds.h"
#include "../common/spdat.h"
#include "guild_mgr.h"
#include "net.h"
#include "petitions.h"
@@ -49,6 +49,10 @@
#define strcasecmp _stricmp
#endif
#ifdef BOTS
#include "bot.h"
#endif
extern Zone *zone;
extern volatile bool ZoneLoaded;
extern WorldServer worldserver;
+19 -14
View File
@@ -17,6 +17,7 @@
*/
#ifndef ENTITY_H
#define ENTITY_H
#include <unordered_map>
#include <queue>
@@ -26,26 +27,30 @@
#include "../common/bodytypes.h"
#include "../common/eq_constants.h"
#include "zonedb.h"
#include "zonedump.h"
#include "qglobals.h"
class EQApplicationPacket;
class Client;
class Mob;
class NPC;
class Merc;
class Corpse;
class Beacon;
class Petition;
class Object;
class Group;
class Raid;
class Client;
class Corpse;
class Doors;
class Trap;
class EQApplicationPacket;
class Entity;
class EntityList;
class Group;
class Merc;
class Mob;
class NPC;
class Object;
class Petition;
class Raid;
class Spawn2;
class Trap;
struct GuildBankItemUpdate_Struct;
struct NewSpawn_Struct;
struct QGlobal;
struct UseAA_Struct;
struct Who_All_Struct;
#ifdef BOTS
class Bot;
+14 -4
View File
@@ -15,14 +15,24 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/features.h"
#include "masterentity.h"
#include "string_ids.h"
#include "../common/string_util.h"
#include "../common/rulesys.h"
#include "quest_parser_collection.h"
#include "../common/string_util.h"
#include "client.h"
#include "groups.h"
#include "mob.h"
#include "raids.h"
#include "queryserv.h"
#include "quest_parser_collection.h"
#include "string_ids.h"
#ifdef BOTS
#include "bot.h"
#endif
extern QueryServ* QServ;
+3 -8
View File
@@ -16,17 +16,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include "../common/rulesys.h"
#include "../common/misc_functions.h"
#include "map.h"
#include "zone.h"
#include "pathing.h"
#include "zone.h"
#ifdef _WINDOWS
#define snprintf _snprintf
#endif
+1
View File
@@ -22,6 +22,7 @@
#include "../common/packet_dump.h"
#include "../common/string_util.h"
#include "worldserver.h"
extern EntityList entity_list;
extern WorldServer worldserver;
+6 -6
View File
@@ -18,14 +18,14 @@
#ifndef GROUPS_H
#define GROUPS_H
#include "../common/types.h"
#include "../common/linked_list.h"
#include "../common/emu_opcodes.h"
#include "../common/eq_packet_structs.h"
#include "entity.h"
#include "../common/types.h"
#include "mob.h"
#include "../common/features.h"
#include "../common/servertalk.h"
class Client;
class EQApplicationPacket;
class Mob;
#define MAX_MARKED_NPCS 3
+5 -4
View File
@@ -15,14 +15,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "guild_mgr.h"
#include "zonedb.h"
#include "worldserver.h"
#include "../common/servertalk.h"
#include "../common/string_util.h"
#include "client.h"
#include "entity.h"
#include "guild_mgr.h"
#include "worldserver.h"
#include "zonedb.h"
ZoneGuildManager guild_mgr;
GuildBankManager *GuildBanks;
+10 -7
View File
@@ -16,19 +16,22 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include <assert.h>
#include <stdlib.h>
#include <math.h>
#include <list>
#include "masterentity.h"
#include "client.h"
#include "entity.h"
#include "groups.h"
#include "mob.h"
#include "raids.h"
#include "../common/rulesys.h"
#include "../common/misc_functions.h"
#include "hate_list.h"
#include "quest_parser_collection.h"
#include "zone.h"
#include "water_map.h"
#include <stdlib.h>
#include <list>
extern Zone *zone;
HateList::HateList()
+6
View File
@@ -19,6 +19,12 @@
#ifndef HATELIST_H
#define HATELIST_H
class Client;
class Group;
class Mob;
class Raid;
struct ExtraAttackOptions;
struct tHateEntry
{
Mob *ent;
+5 -5
View File
@@ -17,13 +17,13 @@
*/
#include "../common/debug.h"
#include "masterentity.h"
#include "../common/item.h"
#include "../common/linked_list.h"
#include "../common/string_util.h"
#include <math.h>
#include <assert.h>
#include "worldserver.h"
#include "client.h"
#include "entity.h"
#include "horse.h"
#include "mob.h"
std::map<uint16, const NPCType *> Horse::horse_types;
LinkedList<NPCType *> horses_auto_delete;
+5 -1
View File
@@ -18,11 +18,15 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#ifndef HORSES_H
#define HORSES_H
#include "../common/debug.h"
#include "npc.h"
#include <map>
class Client;
class Mob;
struct NPCType;
struct NewSpawn_Struct;
class Horse : public NPC {
public:
Horse(Client *owner, uint16 spell_id, float x, float y, float z, float heading);
+46 -41
View File
@@ -189,7 +189,7 @@ bool Client::CheckLoreConflict(const Item_Struct* item) {
return (m_inv.HasItemByLoreGroup(item->LoreGroup, ~invWhereSharedBank) != INVALID_INDEX);
}
bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile) {
bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, bool attuned, uint16 to_slot, uint32 ornament_icon, uint32 ornament_idfile, uint32 ornament_hero_model) {
this->EVENT_ITEM_ScriptStopReturn();
// TODO: update calling methods and script apis to handle a failure return
@@ -199,8 +199,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// make sure the item exists
if(item == nullptr) {
Message(13, "Item %u does not exist.", item_id);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -212,10 +212,10 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
return false;
}
// check to make sure we are augmenting an augmentable item
else if(((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5)) {
else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) {
Message(13, "You can not augment an augment or a non-common class item.");
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -228,14 +228,14 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
/*
else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) {
Message(13, "You are not a GM or do not have the status to summon this item.");
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n",
GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, item->MinStatus);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n",
GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
return false;
}
*/
uint32 augments[EmuConstants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5 };
uint32 augments[EmuConstants::ITEM_COMMON_SIZE] = { aug1, aug2, aug3, aug4, aug5, aug6 };
uint32 classes = item->Classes;
uint32 races = item->Races;
@@ -251,8 +251,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
if(augtest == nullptr) {
if(augments[iter]) {
Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -268,8 +268,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// check that augment is an actual augment
else if(augtest->AugType == 0) {
Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) {
Message(13, "You are not a GM or do not have the status to summon this augment.");
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n",
GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, item->MinStatus);
GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus);
return false;
}
@@ -291,16 +291,16 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
if(enforcewear) {
if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) {
Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
if(item->AugSlotVisible[iter] == 0) {
Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -476,8 +476,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
if(restrictfail) {
Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -487,8 +487,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// check for class usability
if(item->Classes && !(classes &= augtest->Classes)) {
Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1));
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -496,8 +496,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// check for race usability
if(item->Races && !(races &= augtest->Races)) {
Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1));
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -505,8 +505,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// check for slot usability
if(item->Slots && !(slots &= augtest->Slots)) {
Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1));
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -532,8 +532,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
if(inst == nullptr) {
Message(13, "An unknown server error has occurred and your item was not created.");
// this goes to logfile since this is a major error
LogFile->write(EQEMuLog::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5);
LogFile->write(EQEMuLog::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
return false;
}
@@ -546,12 +546,11 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
// attune item
if(attuned && inst->GetItem()->Attuneable)
inst->SetInstNoDrop(true);
inst->SetAttuned(true);
if(ornament_icon > 0 && ornament_idfile > 0) {
inst->SetOrnamentIcon(ornament_icon);
inst->SetOrnamentationIDFile(ornament_idfile);
}
inst->SetOrnamentIcon(ornament_icon);
inst->SetOrnamentationIDFile(ornament_idfile);
inst->SetOrnamentHeroModel(ornament_hero_model);
// check to see if item is usable in requested slot
if(enforceusable && (((to_slot >= MainCharm) && (to_slot <= MainAmmo)) || (to_slot == MainPowerSource))) {
@@ -559,8 +558,8 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
if(!(slots & ((uint32)1 << slottest))) {
Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u)\n",
GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5);
mlog(INVENTORY__ERROR, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n",
GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6);
to_slot = MainCursor;
}
@@ -581,11 +580,13 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
if((RuleB(Character, EnableDiscoveredItems)) && !GetGM()) {
if(!IsDiscovered(item_id))
DiscoverItem(item_id);
/*
// Augments should have been discovered prior to being placed on an item.
for (int iter = AUG_BEGIN; iter < EmuConstants::ITEM_COMMON_SIZE; ++iter) {
if(augments[iter] && !IsDiscovered(augments[iter]))
DiscoverItem(augments[iter]);
}
*/
}
return true;
@@ -819,7 +820,11 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client
m_inv.PutItem(slot_id, inst);
if (client_update)
{
SendItemPacket(slot_id, &inst, ((slot_id == MainCursor) ? ItemPacketSummonItem : ItemPacketTrade));
//SendWearChange(Inventory::CalcMaterialFromSlot(slot_id));
}
if (slot_id == MainCursor) {
std::list<ItemInst*>::const_iterator s = m_inv.cursor_begin(), e = m_inv.cursor_end();
@@ -853,7 +858,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI
{
if(bag_item_data[i] == nullptr)
continue;
const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5);
const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned);
interior_slot = Inventory::CalcSlotId(slot_id, i);
mlog(INVENTORY__SLOTS, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i);
PutLootInInventory(interior_slot, *bagitem);
@@ -1617,13 +1622,13 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
// Not dealing with charges - just do direct swap
if(src_inst && (dst_slot_id <= EmuConstants::EQUIPMENT_END || dst_slot_id == MainPowerSource) && dst_slot_id >= EmuConstants::EQUIPMENT_BEGIN) {
if (src_inst->GetItem()->Attuneable) {
src_inst->SetInstNoDrop(true);
src_inst->SetAttuned(true);
}
if (src_inst->IsAugmented()) {
for (int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
if (src_inst->GetAugment(i)) {
if (src_inst->GetAugment(i)->GetItem()->Attuneable) {
src_inst->GetAugment(i)->SetInstNoDrop(true);
src_inst->GetAugment(i)->SetAttuned(true);
}
}
}
@@ -2292,7 +2297,7 @@ void Client::MoveSlotNotAllowed(bool client_update) {
// these functions operate with a material slot, which is from 0 to 8
uint32 Client::GetEquipment(uint8 material_slot) const
{
int invslot;
int16 invslot;
const ItemInst *item;
if(material_slot > EmuConstants::MATERIAL_END)
@@ -2301,7 +2306,7 @@ uint32 Client::GetEquipment(uint8 material_slot) const
}
invslot = Inventory::CalcSlotFromMaterial(material_slot);
if(invslot == -1)
if (invslot == INVALID_INDEX)
{
return 0;
}
+13 -6
View File
@@ -15,15 +15,20 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include "npc.h"
#include "masterentity.h"
#include "zonedb.h"
#include "../common/loottable.h"
#include "../common/misc_functions.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#include "npc.h"
#include "zonedb.h"
#include <iostream>
#include <stdlib.h>
#ifdef _WINDOWS
#define snprintf _snprintf
#endif
@@ -201,6 +206,8 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge
item->aug_3 = 0;
item->aug_4 = 0;
item->aug_5 = 0;
item->aug_6 = 0;
item->attuned = 0;
item->min_level = minlevel;
item->max_level = maxlevel;
if (equipit) {
+2 -2
View File
@@ -703,13 +703,13 @@ void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug
void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5,
bool attuned) {
Lua_Safe_Call_Void();
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attuned);
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned);
}
void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5,
bool attuned, int to_slot) {
Lua_Safe_Call_Void();
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attuned, to_slot);
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned, to_slot);
}
void Lua_Client::SetStats(int type, int value) {
+2 -2
View File
@@ -166,12 +166,12 @@ uint32 Lua_ItemInst::GetColor() {
bool Lua_ItemInst::IsInstNoDrop() {
Lua_Safe_Call_Bool();
return self->IsInstNoDrop();
return self->IsAttuned();
}
void Lua_ItemInst::SetInstNoDrop(bool flag) {
Lua_Safe_Call_Void();
return self->SetInstNoDrop(flag);
return self->SetAttuned(flag);
}
std::string Lua_ItemInst::GetCustomDataString() {
+4 -4
View File
@@ -1,15 +1,15 @@
#include "../common/debug.h"
#include "../common/misc_functions.h"
#include "map.h"
#include "raycast_mesh.h"
#include "zone.h"
#include <stdint.h>
#include <algorithm>
#include <locale>
#include <vector>
#include <map>
#include <memory>
#include <tuple>
#include <map>
#include <vector>
#include <zlib.h>
uint32 InflateData(const char* buffer, uint32 len, char* out_buffer, uint32 out_len_max) {
-1
View File
@@ -23,7 +23,6 @@
#define ZONE_MAP_H
#include <stdio.h>
#include <string>
#define BEST_Z_INVALID -99999
+9 -6
View File
@@ -1,18 +1,21 @@
#include "merc.h"
#include "masterentity.h"
#include "npc_ai.h"
#include "../common/packet_dump.h"
#include "client.h"
#include "corpse.h"
#include "entity.h"
#include "groups.h"
#include "mob.h"
#include "../common/eq_packet_structs.h"
#include "../common/eq_constants.h"
#include "../common/skills.h"
#include "../common/spdat.h"
#include "zone.h"
#include "string_ids.h"
#include "../common/misc_functions.h"
#include "../common/string_util.h"
#include "../common/rulesys.h"
#include "quest_parser_collection.h"
#include "water_map.h"
extern volatile bool ZoneLoaded;
+11 -2
View File
@@ -1,9 +1,18 @@
#ifndef MERC_H
#define MERC_H
#include "mob.h"
#include "zonedb.h"
#include "npc.h"
class Client;
class Corpse;
class Group;
class Mob;
class Raid;
struct Item_Struct;
struct MercTemplate;
struct NPCType;
struct NewSpawn_Struct;
#define MERC_DEBUG 0
#define MAXMERCS 1
#define TANK 1
+94 -84
View File
@@ -27,6 +27,10 @@
#include <math.h>
#include <sstream>
#ifdef BOTS
#include "bot.h"
#endif
extern EntityList entity_list;
extern Zone* zone;
@@ -972,36 +976,15 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
strn0cpy(ns->spawn.lastName, lastname, sizeof(ns->spawn.lastName));
const Item_Struct *item;
for (i = 0; i < _MaterialCount; i++)
{
// Only Player Races Wear Armor
if (IsPlayerRace(race) || i > 6)
if (Mob::IsPlayerRace(race) || i > 6)
{
ns->spawn.equipment[i].material = GetEquipmentMaterial(i);
item = database.GetItem(GetEquipment(i));
if (item != 0)
{
ns->spawn.equipment[i].elitematerial = item->EliteMaterial;
ns->spawn.equipment[i].heroforgemodel = item->HerosForgeModel;
if (armor_tint[i])
{
ns->spawn.colors[i].color = armor_tint[i];
}
else
{
ns->spawn.colors[i].color = item->Color;
}
}
else
{
if (armor_tint[i])
{
ns->spawn.colors[i].color = armor_tint[i];
}
}
ns->spawn.equipment[i].elitematerial = IsEliteMaterialItem(i);
ns->spawn.equipment[i].heroforgemodel = GetHerosForgeModel(i);
ns->spawn.colors[i].color = GetEquipmentColor(i);
}
}
@@ -1023,7 +1006,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
//ns->spawn.DestructibleAppearance = static_cast<EmuAppearance>(_appearance);
// #appearance 44 1 makes it jump but no visible damage
// #appearance 44 2 makes it look completely broken but still visible
// #appearnace 44 3 makes it jump but not visible difference to 3
// #appearance 44 3 makes it jump but not visible difference to 3
// #appearance 44 4 makes it disappear altogether
// #appearance 44 5 makes the client crash.
@@ -2627,8 +2610,8 @@ uint32 NPC::GetEquipment(uint8 material_slot) const
{
if(material_slot > 8)
return 0;
int invslot = Inventory::CalcSlotFromMaterial(material_slot);
if (invslot == -1)
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
return 0;
return equipment[invslot];
}
@@ -2640,20 +2623,9 @@ void Mob::SendWearChange(uint8 material_slot)
wc->spawn_id = GetID();
wc->material = GetEquipmentMaterial(material_slot);
const Item_Struct *item;
item = database.GetItem(GetEquipment(material_slot));
if (item != 0)
{
wc->elite_material = item->EliteMaterial;
wc->hero_forge_model = item->HerosForgeModel;
wc->color.color = item->Color;
}
else
{
wc->elite_material = 0;
wc->hero_forge_model = 0;
wc->color.color = 0;
}
wc->elite_material = IsEliteMaterialItem(material_slot);
wc->hero_forge_model = GetHerosForgeModel(material_slot);
wc->color.color = GetEquipmentColor(material_slot);
wc->wear_slot_id = material_slot;
entity_list.QueueClients(this, outapp);
@@ -2697,7 +2669,7 @@ void Mob::SetSlotTint(uint8 material_slot, uint8 red_tint, uint8 green_tint, uin
wc->spawn_id = this->GetID();
wc->material = GetEquipmentMaterial(material_slot);
wc->hero_forge_model = GetHeroForgeModel(material_slot);
wc->hero_forge_model = GetHerosForgeModel(material_slot);
wc->color.color = color;
wc->wear_slot_id = material_slot;
@@ -2724,48 +2696,99 @@ void Mob::WearChange(uint8 material_slot, uint16 texture, uint32 color, uint32 h
int32 Mob::GetEquipmentMaterial(uint8 material_slot) const
{
uint32 equipmaterial = 0;
int32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const Item_Struct *item;
int ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
item = database.GetItem(GetEquipment(material_slot));
if(item != 0)
if (item != 0)
{
if // for primary and secondary we need the model, not the material
(
material_slot == MaterialPrimary ||
material_slot == MaterialSecondary
)
// For primary and secondary we need the model, not the material
if (material_slot == MaterialPrimary || material_slot == MaterialSecondary)
{
if (this->IsClient()){
int currMatslot = MaterialPrimary == material_slot ? MainPrimary : MainSecondary;
const ItemInst* inst = CastToClient()->m_inv[currMatslot];
if (inst && inst->GetOrnamentationAug(ornamentationAugtype)) {
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
return atoi(&item->IDFile[2]);
if (this->IsClient())
{
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
{
return 0;
}
else if (inst->GetOrnamentationIcon() && inst->GetOrnamentationIDFile()) {
return inst->GetOrnamentationIDFile();
}
else {
if (strlen(item->IDFile) > 2)
return atoi(&item->IDFile[2]);
else //may as well try this, since were going to 0 anyways
return item->Material;
const ItemInst* inst = CastToClient()->m_inv[invslot];
if (inst)
{
if (inst->GetOrnamentationAug(ornamentationAugtype))
{
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
if (item && strlen(item->IDFile) > 2)
{
equipmaterial = atoi(&item->IDFile[2]);
}
}
else if (inst->GetOrnamentationIDFile())
{
equipmaterial = inst->GetOrnamentationIDFile();
}
}
}
else {
if (strlen(item->IDFile) > 2)
return atoi(&item->IDFile[2]);
else //may as well try this, since were going to 0 anyways
return item->Material;
if (equipmaterial == 0 && strlen(item->IDFile) > 2)
{
equipmaterial = atoi(&item->IDFile[2]);
}
}
else
{
return item->Material;
equipmaterial = item->Material;
}
}
return 0;
return equipmaterial;
}
int32 Mob::GetHerosForgeModel(uint8 material_slot) const
{
uint32 HeroModel = 0;
if (material_slot >= 0 && material_slot < MaterialPrimary)
{
uint32 ornamentationAugtype = RuleI(Character, OrnamentationAugmentType);
const Item_Struct *item;
item = database.GetItem(GetEquipment(material_slot));
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
if (item != 0 && invslot != INVALID_INDEX)
{
if (this->IsClient())
{
const ItemInst* inst = CastToClient()->m_inv[invslot];
if (inst)
{
if (inst->GetOrnamentationAug(ornamentationAugtype))
{
item = inst->GetOrnamentationAug(ornamentationAugtype)->GetItem();
HeroModel = item->HerosForgeModel;
}
else if (inst->GetOrnamentHeroModel())
{
HeroModel = inst->GetOrnamentHeroModel();
}
}
}
if (HeroModel == 0)
{
HeroModel = item->HerosForgeModel;
}
}
}
if (HeroModel > 0)
{
HeroModel *= 100;
HeroModel += material_slot;
}
return HeroModel;
}
uint32 Mob::GetEquipmentColor(uint8 material_slot) const
@@ -2794,19 +2817,6 @@ uint32 Mob::IsEliteMaterialItem(uint8 material_slot) const
return 0;
}
uint32 Mob::GetHeroForgeModel(uint8 material_slot) const
{
const Item_Struct *item;
item = database.GetItem(GetEquipment(material_slot));
if (item != 0)
{
return item->HerosForgeModel;
}
return 0;
}
// works just like a printf
void Mob::Say(const char *format, ...)
{
+1 -1
View File
@@ -312,9 +312,9 @@ public:
virtual uint16 GetSkill(SkillUseTypes skill_num) const { return 0; }
virtual uint32 GetEquipment(uint8 material_slot) const { return(0); }
virtual int32 GetEquipmentMaterial(uint8 material_slot) const;
virtual int32 GetHerosForgeModel(uint8 material_slot) const;
virtual uint32 GetEquipmentColor(uint8 material_slot) const;
virtual uint32 IsEliteMaterialItem(uint8 material_slot) const;
virtual uint32 GetHeroForgeModel(uint8 material_slot) const;
bool AffectedBySpellExcludingSlot(int slot, int effect);
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill) = 0;
virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill,
+15 -15
View File
@@ -15,27 +15,27 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include "npc.h"
#include "masterentity.h"
#include "npc_ai.h"
#include "map.h"
#include "../common/moremath.h"
#include "string_ids.h"
#include "../common/misc_functions.h"
#include "../common/string_util.h"
#include "../common/rulesys.h"
#include "../common/features.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "client.h"
#include "entity.h"
#include "map.h"
#include "mob.h"
#include "npc.h"
#include "quest_parser_collection.h"
#include "string_ids.h"
#include "water_map.h"
#include "remote_call.h"
#include "remote_call_subscribe.h"
#include <algorithm>
#include <iostream>
#include <math.h>
extern EntityList entity_list;
extern Zone *zone;
@@ -1090,7 +1090,7 @@ void Mob::AI_Process() {
{
// we are prevented from getting here if we are blind and don't have a target in range
// from above, so no extra blind checks needed
if (IsRooted() || IsBlind())
if ((IsRooted() && !GetSpecialAbility(IGNORE_ROOT_AGGRO_RULES)) || IsBlind())
SetTarget(hate_list.GetClosest(this));
else
{
+8 -5
View File
@@ -1322,11 +1322,14 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
if (material_slot >= _MaterialCount)
return 0;
int inv_slot = Inventory::CalcSlotFromMaterial(material_slot);
if (inv_slot == -1)
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
if (invslot == INVALID_INDEX)
return 0;
if(equipment[inv_slot] == 0) {
switch(material_slot) {
if (equipment[invslot] == 0)
{
switch(material_slot)
{
case MaterialHead:
return helmtexture;
case MaterialChest:
@@ -1342,7 +1345,7 @@ int32 NPC::GetEquipmentMaterial(uint8 material_slot) const
}
//they have some loot item in this slot, pass it up to the default handler
return(Mob::GetEquipmentMaterial(material_slot));
return (Mob::GetEquipmentMaterial(material_slot));
}
uint32 NPC::GetMaxDamage(uint8 tlevel)
+8 -10
View File
@@ -17,19 +17,17 @@
*/
#include "../common/debug.h"
#include <iostream>
#include <stdlib.h>
#include "masterentity.h"
#include "zonedb.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/misc_functions.h"
#include "../common/string_util.h"
#include "../common/features.h"
#include "string_ids.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#include "object.h"
#include "quest_parser_collection.h"
#include "zonedb.h"
#include <iostream>
const char DEFAULT_OBJECT_NAME[] = "IT63_ACTORDEF";
const char DEFAULT_OBJECT_NAME_SUFFIX[] = "_ACTORDEF";
+7 -8
View File
@@ -21,16 +21,15 @@
// Object Class:
// Represents Zone Objects (forges, ovens, brew barrels, items dropped to ground, etc)
#include "../common/types.h"
#include "../common/linked_list.h"
#include "../common/emu_opcodes.h"
#include "../common/eq_packet_structs.h"
#include "../common/item.h"
#include "client.h"
#include "mob.h"
#include "npc.h"
#include "entity.h"
#include "../common/timer.h"
#include "../common/types.h"
#include "entity.h"
class Client;
class EQApplicationPacket;
class ItemInst;
/*
item icon numbers (showeq)
+10 -10
View File
@@ -1,22 +1,22 @@
#include "../common/debug.h"
#include <string.h>
#include <math.h>
#include <list>
#include <algorithm>
#include <sstream>
#include <fstream>
#include "client.h"
#include "doors.h"
#include "pathing.h"
#include "water_map.h"
#include "../common/misc_functions.h"
#include "doors.h"
#include "client.h"
#include "zone.h"
#include <fstream>
#include <list>
#include <math.h>
#include <sstream>
#include <string.h>
#ifdef _WINDOWS
#define snprintf _snprintf
#endif
//#define PATHDEBUG
//#define PATHDEBUG
#define ABS(x) ((x)<0?-(x):(x))
extern Zone *zone;
+3 -4
View File
@@ -1,13 +1,12 @@
#ifndef PATHING_H
#define PATHING_H
#include <algorithm>
#include "map.h"
#include "../common/timer.h"
#include <list>
#include <vector>
#include <algorithm>
class Client;
class Mob;
#define PATHNODENEIGHBOURS 50
+1 -1
View File
@@ -3134,7 +3134,7 @@ XS(XS_Client_SummonItem)
slot_id = (uint16)SvUV(ST(9));
}
THIS->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, attune, slot_id);
THIS->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attune, slot_id);
}
XSRETURN_EMPTY;
}
+1 -1
View File
@@ -160,7 +160,7 @@ XS(XS_QuestItem_IsAttuned)
if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->IsInstNoDrop();
RETVAL = THIS->IsAttuned();
ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0));
}
+1
View File
@@ -33,6 +33,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "../common/eq_packet_structs.h"
#include "../common/servertalk.h"
#include "../common/string_util.h"
#include "entity.h"
#include "petitions.h"
#include "worldserver.h"
+1
View File
@@ -22,6 +22,7 @@
#include "../common/misc_functions.h"
#include "../common/mutex.h"
#include "../common/types.h"
#include "client.h"
#include "zonedb.h"
-2
View File
@@ -17,7 +17,6 @@
*/
#include "../common/debug.h"
#include "../common/misc_functions.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "../common/types.h"
@@ -27,7 +26,6 @@
#include "mob.h"
#include "pets.h"
#include "worldserver.h"
#include "zonedb.h"
#ifndef WIN32
+24 -21
View File
@@ -1,28 +1,31 @@
#ifndef PETS_H
#define PETS_H
#define PET_BACKOFF 1
#define PET_GETLOST 2
#define PET_HEALTHREPORT 4
#define PET_GUARDHERE 5
#define PET_GUARDME 6
#define PET_ATTACK 7
#define PET_FOLLOWME 8
#define PET_SITDOWN 9
#define PET_STANDUP 10
#define PET_TAUNT 11
#define PET_HOLD 12
#define PET_NOTAUNT 14
#define PET_LEADER 16
#define PET_SLUMBER 17
#define PET_NOCAST 18
#define PET_FOCUS 19
#define PET_FOCUS_ON 25
#define PET_FOCUS_OFF 26
#define PET_HOLD_ON 27
#define PET_HOLD_OFF 28
#define PET_BACKOFF 1
#define PET_GETLOST 2
#define PET_HEALTHREPORT 4
#define PET_GUARDHERE 5
#define PET_GUARDME 6
#define PET_ATTACK 7
#define PET_FOLLOWME 8
#define PET_SITDOWN 9
#define PET_STANDUP 10
#define PET_TAUNT 11
#define PET_HOLD 12
#define PET_NOTAUNT 14
#define PET_LEADER 16
#define PET_SLUMBER 17
#define PET_NOCAST 18
#define PET_FOCUS 19
#define PET_FOCUS_ON 25
#define PET_FOCUS_OFF 26
#define PET_HOLD_ON 27
#define PET_HOLD_OFF 28
class Pet : public NPC {
class Mob;
struct NPCType;
class Pet : public NPC {
public:
Pet(NPCType *type_data, Mob *owner, PetType type, uint16 spell_id, int16 power);
+2 -3
View File
@@ -1,9 +1,8 @@
#include "../common/debug.h"
#include "../common/string_util.h"
#include "qglobals.h"
#include "masterentity.h"
#include "client.h"
#include "zone.h"
#include "zonedb.h"
void QGlobalCache::AddGlobal(uint32 id, QGlobal global)
{
-3
View File
@@ -2,9 +2,6 @@
#define __QGLOBALS__H
#include <list>
#include <string>
#include <stdlib.h>
#include "../common/timer.h"
class NPC;
class Client;
-1
View File
@@ -23,7 +23,6 @@ Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net)
#include "worldserver.h"
#include "net.h"
#include <iostream>
extern WorldServer worldserver;
extern QueryServ* QServ;
+1 -2
View File
@@ -19,14 +19,13 @@
#include "../common/debug.h"
#include "../common/misc_functions.h"
#include "../common/features.h"
#include "quest_parser_collection.h"
#include "quest_interface.h"
#include "zone.h"
#include "questmgr.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
extern Zone* zone;
extern void MapOpcodes();
+17 -4
View File
@@ -20,19 +20,32 @@
#define _EQE_QUESTPARSERCOLLECTION_H
#include "../common/types.h"
#include "../common/item.h"
#include "masterentity.h"
#include "beacon.h"
#include "client.h"
#include "corpse.h"
#include "doors.h"
#include "groups.h"
#include "mob.h"
#include "object.h"
#include "raids.h"
#include "trap.h"
#include "quest_interface.h"
#include <string.h>
#include <string>
#include <list>
#include <map>
#define QuestFailedToLoad 0xFFFFFFFF
#define QuestUnloaded 0x00
class Client;
class ItemInst;
class Mob;
class NPC;
class QuestInterface;
namespace EQEmu { class Any; }
class QuestParserCollection {
public:
QuestParserCollection();
+3 -2
View File
@@ -22,18 +22,19 @@
#include "../common/skills.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "entity.h"
#include "event_codes.h"
#include "guild_mgr.h"
#include "net.h"
#include "qglobals.h"
#include "queryserv.h"
#include "questmgr.h"
#include "quest_parser_collection.h"
#include "questmgr.h"
#include "spawn2.h"
#include "worldserver.h"
#include "zone.h"
#include "zonedb.h"
#include <iostream>
#include <limits.h>
#include <list>
-1
View File
@@ -21,7 +21,6 @@
#include "../common/timer.h"
#include "tasks.h"
#include <string>
#include <list>
#include <stack>
+9 -5
View File
@@ -15,13 +15,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "masterentity.h"
#include "npc_ai.h"
#include "../common/packet_functions.h"
#include "../common/packet_dump.h"
#include "../common/string_util.h"
#include "client.h"
#include "entity.h"
#include "groups.h"
#include "mob.h"
#include "raids.h"
#include "worldserver.h"
extern EntityList entity_list;
extern WorldServer worldserver;
+1 -4
View File
@@ -19,14 +19,11 @@
#define RAIDS_H
#include "../common/types.h"
#include "../common/linked_list.h"
#include "groups.h"
#include <vector>
#include <string>
#include <queue>
class Client;
class EQApplicationPacket;
class Mob;
enum { //raid packet types:
raidAdd = 0,
+6 -5
View File
@@ -15,16 +15,17 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/string_util.h"
#include <stdlib.h>
#include "spawn2.h"
#include "client.h"
#include "entity.h"
#include "masterentity.h"
#include "zone.h"
#include "spawn2.h"
#include "spawngroup.h"
#include "zonedb.h"
#include "worldserver.h"
#include "zone.h"
#include "zonedb.h"
extern EntityList entity_list;
extern Zone* zone;
-2
View File
@@ -21,8 +21,6 @@
#include "../common/timer.h"
#include "npc.h"
#include <string>
#define SC_AlwaysEnabled 0
class SpawnCondition;
+6 -8
View File
@@ -15,17 +15,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "spawngroup.h"
#include "entity.h"
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include "../common/types.h"
#include "zonedb.h"
#include "../common/misc_functions.h"
#include "../common/string_util.h"
#include "../common/types.h"
#include "entity.h"
#include "spawngroup.h"
#include "zone.h"
#include "zonedb.h"
extern EntityList entity_list;
extern Zone* zone;
-1
View File
@@ -18,7 +18,6 @@
#ifndef SPAWNGROUP_H
#define SPAWNGROUP_H
#include "../common/linked_list.h"
#include "../common/types.h"
#include <map>
+5 -6
View File
@@ -16,15 +16,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/misc_functions.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "masterentity.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#include "string_ids.h"
#include <stdio.h>
#include <string.h>
+2
View File
@@ -23,9 +23,11 @@
#include "../common/rulesys.h"
#include "../common/skills.h"
#include "../common/spdat.h"
#include "quest_parser_collection.h"
#include "string_ids.h"
#include "worldserver.h"
#include <math.h>
#ifndef WIN32
+6
View File
@@ -74,9 +74,11 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "../common/skills.h"
#include "../common/spdat.h"
#include "../common/string_util.h"
#include "quest_parser_collection.h"
#include "string_ids.h"
#include "worldserver.h"
#include <assert.h>
#include <math.h>
@@ -89,6 +91,10 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "../common/packet_dump_file.h"
#endif
#ifdef BOTS
#include "bot.h"
#endif
extern Zone* zone;
+6 -5
View File
@@ -21,20 +21,21 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net)
#include "tasks.h"
#include <string.h>
#include <stdlib.h>
#ifdef _WINDOWS
#define strcasecmp _stricmp
#endif
#include "../common/misc_functions.h"
#include "../common/string_util.h"
#include "../common/rulesys.h"
#include "masterentity.h"
#include "../common/features.h"
#include "quest_parser_collection.h"
#include "../common/string_util.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#include "queryserv.h"
#include "quest_parser_collection.h"
extern QueryServ* QServ;
+2 -2
View File
@@ -21,9 +21,8 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
#define TASKS_H
#include "../common/types.h"
#include "mob.h"
#include <vector>
#include <queue>
#define MAXTASKS 10000
#define MAXTASKSETS 1000
@@ -44,6 +43,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net)
#define RELOADTASKSETS 3
class Client;
class Mob;
struct TaskGoalList_Struct {
int ListID;
+7 -3
View File
@@ -15,11 +15,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/eq_packet_structs.h"
#include "masterentity.h"
#include "titles.h"
#include "../common/string_util.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#include "titles.h"
#include "worldserver.h"
extern WorldServer worldserver;
-2
View File
@@ -18,9 +18,7 @@
#ifndef TITLES_H
#define TITLES_H
#include "../common/types.h"
#include <vector>
#include <string>
class Client;
class EQApplicationPacket;
+4 -3
View File
@@ -17,6 +17,7 @@
*/
#include "../common/debug.h"
#include <stdlib.h>
#include <list>
@@ -24,9 +25,9 @@
#include <netinet/in.h> //for htonl
#endif
#include "../common/misc_functions.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "queryserv.h"
#include "quest_parser_collection.h"
#include "string_ids.h"
@@ -287,7 +288,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const Item_Struct* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->IsInstNoDrop(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, container->GetItem()->Icon, atoi(container->GetItem()->IDFile + 2));
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
if (RuleB(Inventory, DeleteTransformationMold))
user->DeleteItemInInventory(in_combine->container_slot, 0, true);
@@ -307,7 +308,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob
const Item_Struct* new_weapon = inst->GetItem();
user->DeleteItemInInventory(Inventory::CalcSlotId(in_combine->container_slot, 0), 0, true);
container->Clear();
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->IsInstNoDrop(), MainCursor, 0, 0);
user->SummonItem(new_weapon->ID, inst->GetCharges(), inst->GetAugmentItemID(0), inst->GetAugmentItemID(1), inst->GetAugmentItemID(2), inst->GetAugmentItemID(3), inst->GetAugmentItemID(4), inst->GetAugmentItemID(5), inst->IsAttuned(), MainCursor, 0, 0);
user->Message_StringID(4, TRANSFORM_COMPLETE, inst->GetItem()->Name);
}
else if (inst) {
+12 -6
View File
@@ -15,14 +15,20 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "masterentity.h"
#include "string_ids.h"
#include "../common/string_util.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#include "quest_parser_collection.h"
#include "string_ids.h"
#include "worldserver.h"
#include "queryserv.h"
class QueryServ;
extern WorldServer worldserver;
extern QueryServ* QServ;
@@ -878,14 +884,14 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
const Item_Struct* item = inst->GetItem();
if(item && quest_npc == false) {
// if it was not a NO DROP or Attuned item (or if a GM is trading), let the NPC have it
if(GetGM() || (item->NoDrop != 0 && inst->IsInstNoDrop() == false)) {
if(GetGM() || (item->NoDrop != 0 && inst->IsAttuned() == false)) {
// pets need to look inside bags and try to equip items found there
if(item->ItemClass == ItemClassContainer && item->BagSlots > 0) {
for(int16 bslot = SUB_BEGIN; bslot < item->BagSlots; bslot++) {
const ItemInst* baginst = inst->GetItem(bslot);
if (baginst) {
const Item_Struct* bagitem = baginst->GetItem();
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsInstNoDrop() == false))) {
if (bagitem && (GetGM() || (bagitem->NoDrop != 0 && baginst->IsAttuned() == false))) {
tradingWith->CastToNPC()->AddLootDrop(bagitem, &tradingWith->CastToNPC()->itemlist,
baginst->GetCharges(), 1, 127, true, true);
}
+7 -5
View File
@@ -15,13 +15,15 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/types.h"
#include "entity.h"
#include "masterentity.h"
#include "../common/spdat.h"
#include "../common/misc_functions.h"
#include "../common/string_util.h"
#include "../common/types.h"
#include "client.h"
#include "entity.h"
#include "mob.h"
#include "trap.h"
/*
+3 -2
View File
@@ -18,10 +18,11 @@
#ifndef _TRAP_H
#define _TRAP_H
#include "../common/debug.h"
#include "entity.h"
class Mob;
class NPC;
//ID of the NPC type to spawn when a trap is set off, to do the damage
#define TRAP_NPC_TYPE 1586
+4 -4
View File
@@ -15,13 +15,13 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "../common/eq_packet_structs.h"
#include "../common/features.h"
#include "masterentity.h"
#include "../common/packet_dump.h"
#include "../common/misc_functions.h"
#include <string>
#include "client.h"
#include <map>
#ifdef _WINDOWS
+6 -6
View File
@@ -1,14 +1,14 @@
#include "../common/debug.h"
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <functional>
#include <cctype>
#include "water_map.h"
#include "water_map_v1.h"
#include "water_map_v2.h"
#include <algorithm>
#include <cctype>
#include <stdio.h>
#include <string.h>
WaterMap* WaterMap::LoadWaterMapfile(std::string zone_name) {
std::transform(zone_name.begin(), zone_name.end(), zone_name.begin(), ::tolower);
+3 -1
View File
@@ -21,13 +21,15 @@
#endif
#include "../common/features.h"
#include "../common/misc_functions.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "../common/misc_functions.h"
#include "map.h"
#include "npc.h"
#include "quest_parser_collection.h"
#include "water_map.h"
#include <math.h>
#include <stdlib.h>
+11 -13
View File
@@ -15,13 +15,12 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include <iostream>
#include <string.h>
#include <stdio.h>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <stdarg.h>
#ifdef _WINDOWS
@@ -32,25 +31,24 @@
#define strcasecmp _stricmp
#endif
#include "../common/servertalk.h"
#include "../common/eq_packet_structs.h"
#include "../common/packet_dump.h"
#include "../common/misc_functions.h"
#include "../common/packet_functions.h"
#include "../common/md5.h"
#include "../common/rulesys.h"
#include "worldserver.h"
#include "zonedb.h"
#include "zone.h"
#include "../common/servertalk.h"
#include "client.h"
#include "corpse.h"
#include "entity.h"
#include "masterentity.h"
#include "guild_mgr.h"
#include "mob.h"
#include "net.h"
#include "petitions.h"
#include "zone_config.h"
#include "raids.h"
#include "string_ids.h"
#include "guild_mgr.h"
#include "titles.h"
#include "qglobals.h"
#include "worldserver.h"
#include "zone.h"
#include "zone_config.h"
#include "remote_call_subscribe.h"
#include "remote_call.h"
+2 -1
View File
@@ -35,6 +35,7 @@
#include "../common/rulesys.h"
#include "../common/seperator.h"
#include "../common/string_util.h"
#include "client_logs.h"
#include "guild_mgr.h"
#include "map.h"
@@ -48,8 +49,8 @@
#include "spawngroup.h"
#include "water_map.h"
#include "worldserver.h"
#include "zone_config.h"
#include "zone.h"
#include "zone_config.h"
#include "remote_call_subscribe.h"
#ifdef _WINDOWS
+5 -1
View File
@@ -67,10 +67,14 @@ struct item_tick_struct {
std::string qglobal;
};
class Client;
class Map;
class WaterMap;
class Mob;
class PathManager;
class WaterMap;
extern EntityList entity_list;
struct NPCType;
struct ServerZoneIncommingClient_Struct;
class Zone
{
+2 -3
View File
@@ -15,8 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "../common/debug.h"
#include "zone_config.h"
ZoneConfig *ZoneConfig::_zone_config = nullptr;
ZoneConfig *ZoneConfig::_zone_config = nullptr;
+2 -1
View File
@@ -19,9 +19,10 @@
#include "../common/debug.h"
#include "../common/logsys.h"
#include "../common/base_packet.h"
#include "mob.h"
#include <stdarg.h>
#include <stdio.h>
void log_message_mob(LogType type, Mob *who, const char *fmt, ...) {
if(!who->IsLoggingEnabled())
+26 -15
View File
@@ -1,14 +1,17 @@
#include "../common/extprofile.h"
#include "../common/item.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "client.h"
#include "corpse.h"
#include "groups.h"
#include "merc.h"
#include "zone.h"
#include "zonedb.h"
#include <ctime>
#include <iostream>
@@ -427,7 +430,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container)
return;
}
std::string query = StringFormat("SELECT bagidx, itemid, charges, augslot1, augslot2, augslot3, augslot4, augslot5 "
std::string query = StringFormat("SELECT bagidx, itemid, charges, augslot1, augslot2, augslot3, augslot4, augslot5, augslot6 "
"FROM object_contents WHERE parentid = %i", parentid);
auto results = QueryDatabase(query);
if (!results.Success()) {
@@ -440,11 +443,12 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container)
uint32 item_id = (uint32)atoi(row[1]);
int8 charges = (int8)atoi(row[2]);
uint32 aug[EmuConstants::ITEM_COMMON_SIZE];
aug[0] = (uint32)atoi(row[3]);
aug[1] = (uint32)atoi(row[4]);
aug[2] = (uint32)atoi(row[5]);
aug[3] = (uint32)atoi(row[6]);
aug[4] = (uint32)atoi(row[7]);
aug[0] = (uint32)atoi(row[3]);
aug[1] = (uint32)atoi(row[4]);
aug[2] = (uint32)atoi(row[5]);
aug[3] = (uint32)atoi(row[6]);
aug[4] = (uint32)atoi(row[7]);
aug[5] = (uint32)atoi(row[8]);
ItemInst* inst = database.CreateItem(item_id, charges);
if (inst && inst->GetItem()->ItemClass == ItemClassCommon) {
@@ -478,7 +482,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It
continue;
uint32 item_id = inst->GetItem()->ID;
uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
uint32 augslot[EmuConstants::ITEM_COMMON_SIZE] = { NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM, NO_ITEM };
if (inst->IsType(ItemClassCommon)) {
for(int i = AUG_BEGIN; i < EmuConstants::ITEM_COMMON_SIZE; i++) {
@@ -489,10 +493,10 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It
std::string query = StringFormat("REPLACE INTO object_contents "
"(zoneid, parentid, bagidx, itemid, charges, "
"augslot1, augslot2, augslot3, augslot4, augslot5, droptime) "
"VALUES (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, now())",
"augslot1, augslot2, augslot3, augslot4, augslot5, augslot6, droptime) "
"VALUES (%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i, now())",
zone_id, parent_id, index, item_id, inst->GetCharges(),
augslot[0], augslot[1], augslot[2], augslot[3], augslot[4]);
augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]);
auto results = QueryDatabase(query);
if (!results.Success())
LogFile->write(EQEMuLog::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str());
@@ -3568,8 +3572,8 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui
for (unsigned int i = 0; i < dbpc->itemcount; i++) {
if (first_entry != 1){
query = StringFormat("REPLACE INTO `character_corpse_items` \n"
" (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, attuned) \n"
" VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n",
" (corpse_id, equip_slot, item_id, charges, aug_1, aug_2, aug_3, aug_4, aug_5, aug_6, attuned) \n"
" VALUES (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n",
last_insert_id,
dbpc->items[i].equip_slot,
dbpc->items[i].item_id,
@@ -3578,12 +3582,14 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui
dbpc->items[i].aug_2,
dbpc->items[i].aug_3,
dbpc->items[i].aug_4,
dbpc->items[i].aug_5
dbpc->items[i].aug_5,
dbpc->items[i].aug_6,
dbpc->items[i].attuned
);
first_entry = 1;
}
else{
query = query + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, 0) \n",
query = query + StringFormat(", (%u, %u, %u, %u, %u, %u, %u, %u, %u, %u, %u) \n",
last_insert_id,
dbpc->items[i].equip_slot,
dbpc->items[i].item_id,
@@ -3592,7 +3598,9 @@ uint32 ZoneDatabase::SaveCharacterCorpse(uint32 charid, const char* charname, ui
dbpc->items[i].aug_2,
dbpc->items[i].aug_3,
dbpc->items[i].aug_4,
dbpc->items[i].aug_5
dbpc->items[i].aug_5,
dbpc->items[i].aug_6,
dbpc->items[i].attuned
);
}
}
@@ -3743,6 +3751,7 @@ bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct
"aug_3, \n"
"aug_4, \n"
"aug_5, \n"
"aug_6, \n"
"attuned \n"
"FROM \n"
"character_corpse_items \n"
@@ -3765,6 +3774,8 @@ bool ZoneDatabase::LoadCharacterCorpseData(uint32 corpse_id, PlayerCorpse_Struct
pcs->items[i].aug_3 = atoi(row[r++]); // aug_3,
pcs->items[i].aug_4 = atoi(row[r++]); // aug_4,
pcs->items[i].aug_5 = atoi(row[r++]); // aug_5,
pcs->items[i].aug_6 = atoi(row[r++]); // aug_6,
pcs->items[i].attuned = atoi(row[r++]); // attuned,
r = 0;
i++;
}
+2
View File
@@ -139,6 +139,8 @@ namespace player_lootitem {
uint32 aug_3;
uint32 aug_4;
uint32 aug_5;
uint32 aug_6;
int8 attuned;
uint8 min_level; //
uint8 max_level; //
};
+5
View File
@@ -19,12 +19,17 @@
#include "../common/debug.h"
#include "../common/rulesys.h"
#include "../common/string_util.h"
#include "queryserv.h"
#include "quest_parser_collection.h"
#include "string_ids.h"
#include "worldserver.h"
#include "zone.h"
#ifdef BOTS
#include "bot.h"
#endif
extern QueryServ* QServ;
extern WorldServer worldserver;
extern Zone* zone;