diff --git a/sql/updates/1556_characters_ahbot.sql b/sql/updates/1556_characters_ahbot.sql new file mode 100644 index 00000000000..85c0b14bac4 --- /dev/null +++ b/sql/updates/1556_characters_ahbot.sql @@ -0,0 +1,3 @@ +ALTER TABLE `auctionhousebot` + DROP COLUMN `minTime`, + DROP COLUMN `maxTime`; diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index bc0e3b8f80f..06338bbe233 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -122,6 +122,9 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args) } else if (strncmp(opt,"maxitems",l) == 0) { + PSendSysMessage("ahbotoptions mintime has been deprecated"); + return false; + /* char * param1 = strtok(NULL, " "); if ((!ahMapIdStr) || (!param1)) { @@ -129,6 +132,7 @@ bool ChatHandler::HandleAHBotOptionsCommand(const char* args) return false; } AuctionHouseBotCommands(2, ahMapID, NULL, param1); + */ } else if (strncmp(opt,"mintime",l) == 0) { diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 4b410480ebe..8ca1dc6f82a 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2555,18 +2555,29 @@ void Spell::cancel() void Spell::cast(bool skipCheck) { - SetExecutedCurrently(true); - // update pointers base at GUIDs to prevent access to non-existed already object UpdatePointers(); - // cancel at lost main target unit - if(!m_targets.getUnitTarget() && m_targets.getUnitTargetGUID() && m_targets.getUnitTargetGUID() != m_caster->GetGUID()) + if(m_targets.getUnitTarget()) { - cancel(); - SetExecutedCurrently(false); - return; + // three check: prepare, cast (m_casttime > 0), hit (delayed) + if(m_casttime && m_targets.getUnitTarget()->isAlive() && !m_caster->canSeeOrDetect(m_targets.getUnitTarget(), true))) + { + cancel(); + return; + } } + else + { + // cancel at lost main target unit + if(m_targets.getUnitTargetGUID() && m_targets.getUnitTargetGUID() != m_caster->GetGUID()) + { + cancel(); + return; + } + } + + SetExecutedCurrently(true); if(m_caster->GetTypeId() != TYPEID_PLAYER && m_targets.getUnitTarget() && m_targets.getUnitTarget() != m_caster) m_caster->SetInFront(m_targets.getUnitTarget()); diff --git a/src/shared/Database/DBCStructure.h b/src/shared/Database/DBCStructure.h new file mode 100644 index 00000000000..8e8aa8bfba8 --- /dev/null +++ b/src/shared/Database/DBCStructure.h @@ -0,0 +1,904 @@ +/* + * Copyright (C) 2005-2008 MaNGOS + * + * Copyright (C) 2008 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef DBCSTRUCTURE_H +#define DBCSTRUCTURE_H + +#include "DBCEnums.h" +#include "Platform/Define.h" + +#include +#include +#include + +// Structures using to access raw DBC data and required packing to portability + +// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push,N), also any gcc version not support it at some platform +#if defined( __GNUC__ ) +#pragma pack(1) +#else +#pragma pack(push,1) +#endif + +struct AreaTableEntry +{ + uint32 ID; // 0 + uint32 mapid; // 1 + uint32 zone; // 2 if 0 then it's zone, else it's zone id of this area + uint32 exploreFlag; // 3, main index + uint32 flags; // 4, unknown value but 312 for all cities + // 5-9 unused + int32 area_level; // 10 + char* area_name[16]; // 11-26 + // 27, string flags, unused + uint32 team; // 28 +}; + +struct AreaTriggerEntry +{ + uint32 id; // 0 + uint32 mapid; // 1 + float x; // 2 + float y; // 3 + float z; // 4 + float radius; // 5 + float box_x; // 6 extent x edge + float box_y; // 7 extent y edge + float box_z; // 8 extent z edge + float box_orientation; // 9 extent rotation by about z axis +}; + +struct AuctionHouseEntry +{ + uint32 houseId; // 0 index + uint32 faction; // 1 id of faction.dbc for player factions associated with city + uint32 depositPercent; // 2 1/3 from real + uint32 cutPercent; // 3 + //char* name[16]; // 4-19 + // 20 string flag, unused +}; + +struct BankBagSlotPricesEntry +{ + uint32 ID; + uint32 price; +}; + +struct BattlemasterListEntry +{ + uint32 id; // 0 + uint32 mapid[3]; // 1-3 mapid + // 4-8 unused + uint32 type; // 9 (3 - BG, 4 - arena) + uint32 minlvl; // 10 + uint32 maxlvl; // 11 + uint32 maxplayersperteam; // 12 + // 13-14 unused + char* name[16]; // 15-30 + // 31 string flag, unused + // 32 unused +}; + +#define MAX_OUTFIT_ITEMS 12 +// #define MAX_OUTFIT_ITEMS 24 // 12->24 in 3.0.x + +struct CharStartOutfitEntry +{ + //uint32 Id; // 0 + uint32 RaceClassGender; // 1 (UNIT_FIELD_BYTES_0 & 0x00FFFFFF) comparable (0 byte = race, 1 byte = class, 2 byte = gender) + int32 ItemId[MAX_OUTFIT_ITEMS]; // 2-13 + //int32 ItemDisplayId[MAX_OUTFIT_ITEMS]; // 14-25 not required at server side + //int32 ItemInventorySlot[MAX_OUTFIT_ITEMS]; // 26-37 not required at server side + //uint32 Unknown1; // 38, unique values (index-like with gaps ordered in other way as ids) + //uint32 Unknown2; // 39 + //uint32 Unknown3; // 40 +}; + +struct CharTitlesEntry +{ + uint32 ID; // 0, title ids, for example in Quest::GetCharTitleId() + //uint32 unk1; // 1 flags? + //char* name[16]; // 2-17, unused + // 18 string flag, unused + //char* name2[16]; // 19-34, unused + // 35 string flag, unused + uint32 bit_index; // 36 used in PLAYER_CHOSEN_TITLE and 1<