Merge branch 'master' of git://github.com/TrinityCore/TrinityCore
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
SET @Pinata := 34632;
|
||||
|
||||
DELETE FROM `smart_scripts` WHERE `entryorguid`=@Pinata AND `source_type`=0;
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(@Pinata, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 65788, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ogre Pinata - On death cast Pile of Candy'),
|
||||
(@Pinata, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ogre Pinata - On reset set react state passive');
|
||||
|
||||
-- same faction of the GO that is spawned by spell 65788 (not sniffed)
|
||||
UPDATE `creature_template` SET `faction_A`=7,`faction_H`=7,`exp`=0,`AIName`='SmartAI' WHERE `entry`=@Pinata;
|
||||
@@ -0,0 +1,6 @@
|
||||
-- Corrected proc of Misery
|
||||
DELETE FROM `spell_proc_event` WHERE `entry` IN (33191, 33192, 33193);
|
||||
INSERT INTO `spell_proc_event` VALUES
|
||||
(33191, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0),
|
||||
(33192, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0),
|
||||
(33193, 0x00, 0x06, 0x00008000, 0x00000400, 0x00000040, 0x00000000, 0x00000000, 0, 0, 0);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
UPDATE `conditions` SET ConditionValue3 = 0, ConditionTarget = 1 WHERE ConditionTypeOrReference = 1 AND ConditionValue3 = 1;
|
||||
UPDATE `conditions` SET ConditionTypeOrReference = 31, ConditionValue2 = ConditionValue1, ConditionValue1 = 3, ConditionTarget = 1 WHERE ConditionTypeOrReference = 19;
|
||||
UPDATE `conditions` SET ConditionTypeOrReference = 38, ConditionValue2 = 4, ConditionTarget = 1 WHERE ConditionTypeOrReference = 20;
|
||||
@@ -95,7 +95,7 @@ const std::string& RealmSocket::getRemoteAddress(void) const
|
||||
return _remoteAddress;
|
||||
}
|
||||
|
||||
const uint16 RealmSocket::getRemotePort(void) const
|
||||
uint16 RealmSocket::getRemotePort(void) const
|
||||
{
|
||||
return _remotePort;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
|
||||
const std::string& getRemoteAddress(void) const;
|
||||
|
||||
const uint16 getRemotePort(void) const;
|
||||
uint16 getRemotePort(void) const;
|
||||
|
||||
virtual int open(void *);
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class BIHWrap
|
||||
const T* const* objects;
|
||||
RayCallback& _callback;
|
||||
|
||||
MDLCallback(RayCallback& callback, const T* const* objects_array ) : _callback(callback), objects(objects_array){}
|
||||
MDLCallback(RayCallback& callback, const T* const* objects_array ) : objects(objects_array), _callback(callback) {}
|
||||
|
||||
bool operator() (const Ray& ray, uint32 Idx, float& MaxDist, bool /*stopAtFirst*/)
|
||||
{
|
||||
@@ -106,4 +106,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#endif // _BIH_WRAP
|
||||
#endif // _BIH_WRAP
|
||||
|
||||
@@ -43,10 +43,11 @@ template<> struct BoundsTrait< GameObjectModel> {
|
||||
static void getBounds2(const GameObjectModel* g, G3D::AABox& out) { out = g->getBounds();}
|
||||
};
|
||||
|
||||
/*
|
||||
static bool operator == (const GameObjectModel& mdl, const GameObjectModel& mdl2){
|
||||
return &mdl == &mdl2;
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
int valuesPerNode = 5, numMeanSplits = 3;
|
||||
|
||||
@@ -251,4 +252,4 @@ float DynamicMapTree::getHeight(float x, float y, float z, float maxSearchDist,
|
||||
return v.z - maxSearchDist;
|
||||
else
|
||||
return -G3D::inf();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,16 +344,15 @@ namespace VMAP
|
||||
char buff[500];
|
||||
while (!feof(model_list))
|
||||
{
|
||||
fread(&displayId,sizeof(uint32),1,model_list);
|
||||
fread(&name_length,sizeof(uint32),1,model_list);
|
||||
|
||||
if (name_length >= sizeof(buff))
|
||||
if (fread(&displayId, sizeof(uint32), 1, model_list) != 1
|
||||
|| fread(&name_length, sizeof(uint32), 1, model_list) != 1
|
||||
|| name_length >= sizeof(buff)
|
||||
|| fread(&buff, sizeof(char), name_length, model_list) != name_length)
|
||||
{
|
||||
std::cout << "\nFile 'temp_gameobject_models' seems to be corrupted" << std::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
fread(&buff,sizeof(char),name_length,model_list);
|
||||
std::string model_name(buff, name_length);
|
||||
|
||||
WorldModel_Raw raw_model;
|
||||
|
||||
@@ -36,7 +36,7 @@ using G3D::AABox;
|
||||
struct GameobjectModelData
|
||||
{
|
||||
GameobjectModelData(const std::string& name_, const AABox& box) :
|
||||
name(name_), bound(box) {}
|
||||
bound(box), name(name_) {}
|
||||
|
||||
AABox bound;
|
||||
std::string name;
|
||||
@@ -55,20 +55,18 @@ void LoadGameObjectModelList()
|
||||
char buff[500];
|
||||
while (!feof(model_list_file))
|
||||
{
|
||||
fread(&displayId,sizeof(uint32),1,model_list_file);
|
||||
fread(&name_length,sizeof(uint32),1,model_list_file);
|
||||
|
||||
if (name_length >= sizeof(buff))
|
||||
Vector3 v1, v2;
|
||||
if (fread(&displayId, sizeof(uint32), 1, model_list_file) != 1
|
||||
|| fread(&name_length, sizeof(uint32), 1, model_list_file) != 1
|
||||
|| name_length >= sizeof(buff)
|
||||
|| fread(&buff, sizeof(char), name_length, model_list_file) != name_length
|
||||
|| fread(&v1, sizeof(Vector3), 1, model_list_file) != 1
|
||||
|| fread(&v2, sizeof(Vector3), 1, model_list_file) != 1)
|
||||
{
|
||||
printf("\nFile '%s' seems to be corrupted", VMAP::GAMEOBJECT_MODELS);
|
||||
break;
|
||||
}
|
||||
|
||||
fread(&buff, sizeof(char), name_length,model_list_file);
|
||||
Vector3 v1, v2;
|
||||
fread(&v1, sizeof(Vector3), 1, model_list_file);
|
||||
fread(&v2, sizeof(Vector3), 1, model_list_file);
|
||||
|
||||
model_list.insert
|
||||
(
|
||||
ModelList::value_type( displayId, GameobjectModelData(std::string(buff,name_length),AABox(v1,v2)) )
|
||||
@@ -172,4 +170,4 @@ bool GameObjectModel::intersectRay(const G3D::Ray& ray, float& MaxDist, bool Sto
|
||||
MaxDist = distance;
|
||||
}
|
||||
return hit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ using G3D::Ray;
|
||||
|
||||
template<class Node>
|
||||
struct NodeCreator{
|
||||
static Node * makeNode(int x, int y) { return new Node();}
|
||||
static Node * makeNode(int /*x*/, int /*y*/) { return new Node();}
|
||||
};
|
||||
|
||||
template<class T,
|
||||
@@ -215,4 +215,4 @@ public:
|
||||
#undef CELL_SIZE
|
||||
#undef HGRID_MAP_SIZE
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -648,37 +648,37 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
||||
}
|
||||
|
||||
//this function inserts to WorldPacket auction's data
|
||||
bool AuctionEntry::BuildAuctionInfo(WorldPacket & data) const
|
||||
bool AuctionEntry::BuildAuctionInfo(WorldPacket& data) const
|
||||
{
|
||||
Item* pItem = sAuctionMgr->GetAItem(item_guidlow);
|
||||
if (!pItem)
|
||||
Item* item = sAuctionMgr->GetAItem(item_guidlow);
|
||||
if (!item)
|
||||
{
|
||||
sLog->outError("auction to item, that doesn't exist !!!!");
|
||||
sLog->outError("AuctionEntry::BuildAuctionInfo: Auction %u has a non-existent item: %u", Id, item_guidlow);
|
||||
return false;
|
||||
}
|
||||
data << uint32(Id);
|
||||
data << uint32(pItem->GetEntry());
|
||||
data << uint32(item->GetEntry());
|
||||
|
||||
for (uint8 i = 0; i < MAX_INSPECTED_ENCHANTMENT_SLOT; ++i)
|
||||
{
|
||||
data << uint32(pItem->GetEnchantmentId(EnchantmentSlot(i)));
|
||||
data << uint32(pItem->GetEnchantmentDuration(EnchantmentSlot(i)));
|
||||
data << uint32(pItem->GetEnchantmentCharges(EnchantmentSlot(i)));
|
||||
data << uint32(item->GetEnchantmentId(EnchantmentSlot(i)));
|
||||
data << uint32(item->GetEnchantmentDuration(EnchantmentSlot(i)));
|
||||
data << uint32(item->GetEnchantmentCharges(EnchantmentSlot(i)));
|
||||
}
|
||||
|
||||
data << int32(pItem->GetItemRandomPropertyId()); //random item property id
|
||||
data << uint32(pItem->GetItemSuffixFactor()); //SuffixFactor
|
||||
data << uint32(pItem->GetCount()); //item->count
|
||||
data << uint32(pItem->GetSpellCharges()); //item->charge FFFFFFF
|
||||
data << uint32(0); //Unknown
|
||||
data << uint64(owner); //Auction->owner
|
||||
data << uint32(startbid); //Auction->startbid (not sure if useful)
|
||||
data << int32(item->GetItemRandomPropertyId()); // Random item property id
|
||||
data << uint32(item->GetItemSuffixFactor()); // SuffixFactor
|
||||
data << uint32(item->GetCount()); // item->count
|
||||
data << uint32(item->GetSpellCharges()); // item->charge FFFFFFF
|
||||
data << uint32(0); // Unknown
|
||||
data << uint64(owner); // Auction->owner
|
||||
data << uint32(startbid); // Auction->startbid (not sure if useful)
|
||||
data << uint32(bid ? GetAuctionOutBid() : 0);
|
||||
//minimal outbid
|
||||
data << uint32(buyout); //auction->buyout
|
||||
data << uint32((expire_time-time(NULL))*IN_MILLISECONDS);//time left
|
||||
data << uint64(bidder); //auction->bidder current
|
||||
data << uint32(bid); //current bid
|
||||
// Minimal outbid
|
||||
data << uint32(buyout); // Auction->buyout
|
||||
data << uint32((expire_time - time(NULL)) * IN_MILLISECONDS); // time left
|
||||
data << uint64(bidder); // auction->bidder current
|
||||
data << uint32(bid); // current bid
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
return false;
|
||||
}
|
||||
bool condMeets = false;
|
||||
bool sendErrorMsg = false;
|
||||
switch (ConditionType)
|
||||
{
|
||||
case CONDITION_NONE:
|
||||
@@ -49,15 +48,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
case CONDITION_AURA:
|
||||
{
|
||||
if (Unit* unit = object->ToUnit())
|
||||
{
|
||||
if (!ConditionValue3)
|
||||
condMeets = unit->HasAuraEffect(ConditionValue1, ConditionValue2);
|
||||
else if (Player* player = unit->ToPlayer())
|
||||
{
|
||||
if (Unit* target = player->GetSelectedUnit())
|
||||
condMeets = target->HasAuraEffect(ConditionValue1, ConditionValue2);
|
||||
}
|
||||
}
|
||||
condMeets = unit->HasAuraEffect(ConditionValue1, ConditionValue2);
|
||||
break;
|
||||
}
|
||||
case CONDITION_ITEM:
|
||||
@@ -165,49 +156,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
case CONDITION_SPELL_SCRIPT_TARGET:
|
||||
condMeets = true;//spell target condition is handled in spellsystem, here it is always true
|
||||
break;
|
||||
case CONDITION_CREATURE_TARGET:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
{
|
||||
Unit* target = player->GetSelectedUnit();
|
||||
if (target)
|
||||
if (Creature* cTarget = target->ToCreature())
|
||||
if (cTarget->GetEntry() == ConditionValue1)
|
||||
condMeets = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_TARGET_HEALTH_BELOW_PCT:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
{
|
||||
Unit* target = player->GetSelectedUnit();
|
||||
if (target)
|
||||
condMeets = !target->HealthAbovePct(ConditionValue1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case CONDITION_TARGET_RANGE:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
{
|
||||
if (Unit* target = player->GetSelectedUnit())
|
||||
if (player->GetDistance(target) >= ConditionValue1 && (!ConditionValue2 || player->GetDistance(target) <= ConditionValue2))
|
||||
condMeets = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_MAPID:
|
||||
condMeets = object->GetMapId() == ConditionValue1;
|
||||
break;
|
||||
case CONDITION_AREAID:
|
||||
condMeets = object->GetAreaId() == ConditionValue1;
|
||||
break;
|
||||
case CONDITION_ITEM_TARGET:
|
||||
{
|
||||
condMeets = true; //handled in Item::IsTargetValidForItemUse
|
||||
break;
|
||||
}
|
||||
case CONDITION_SPELL:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
@@ -553,6 +507,9 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
if (iConditionTypeOrReference >= 0)
|
||||
cond->ConditionType = ConditionTypes(iConditionTypeOrReference);
|
||||
|
||||
if (iSourceTypeOrReferenceId >= 0)
|
||||
cond->SourceType = ConditionSourceType(iSourceTypeOrReferenceId);
|
||||
|
||||
if (iConditionTypeOrReference < 0)//it has a reference
|
||||
{
|
||||
if (iConditionTypeOrReference == iSourceTypeOrReferenceId)//self referencing, skip
|
||||
@@ -601,8 +558,6 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
continue;
|
||||
}//end of reference templates
|
||||
|
||||
cond->SourceType = ConditionSourceType(iSourceTypeOrReferenceId);
|
||||
|
||||
//if not a reference and SourceType is invalid, skip
|
||||
if (iConditionTypeOrReference >= 0 && !isSourceTypeValid(cond))
|
||||
{
|
||||
@@ -768,7 +723,7 @@ bool ConditionMgr::addToGossipMenus(Condition* cond)
|
||||
{
|
||||
for (GossipMenusContainer::iterator itr = pMenuBounds.first; itr != pMenuBounds.second; ++itr)
|
||||
{
|
||||
if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == cond->SourceEntry)
|
||||
if ((*itr).second.entry == cond->SourceGroup && (*itr).second.text_id == uint32(cond->SourceEntry))
|
||||
{
|
||||
(*itr).second.conditions.push_back(cond);
|
||||
return true;
|
||||
@@ -787,7 +742,7 @@ bool ConditionMgr::addToGossipMenuItems(Condition* cond)
|
||||
{
|
||||
for (GossipMenuItemsContainer::iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
|
||||
{
|
||||
if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == cond->SourceEntry)
|
||||
if ((*itr).second.MenuId == cond->SourceGroup && (*itr).second.OptionIndex == uint32(cond->SourceEntry))
|
||||
{
|
||||
(*itr).second.Conditions.push_back(cond);
|
||||
return true;
|
||||
@@ -1092,50 +1047,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET:
|
||||
{
|
||||
if (cond->ConditionType != CONDITION_ITEM_TARGET)
|
||||
{
|
||||
sLog->outErrorDb("SourceEntry %u in `condition` table, has ConditionType %u. Only CONDITION_ITEM_TARGET(24) is valid for CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET(18), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
|
||||
return false;
|
||||
}
|
||||
|
||||
ItemTemplate const* pItemProto = sObjectMgr->GetItemTemplate(cond->SourceEntry);
|
||||
if (!pItemProto)
|
||||
{
|
||||
sLog->outErrorDb("SourceEntry %u in `condition` table, does not exist in `item_tamplate`, ignoring.", cond->SourceEntry);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool bIsItemSpellValid = false;
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
{
|
||||
if (SpellInfo const* pSpellInfo = sSpellMgr->GetSpellInfo(pItemProto->Spells[i].SpellId))
|
||||
{
|
||||
if (pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
|
||||
pItemProto->Spells[i].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE)
|
||||
{
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET, pSpellInfo->Id);//script loading is done before item target loading
|
||||
if (!conditions.empty())
|
||||
break;
|
||||
|
||||
if (pSpellInfo->NeedsExplicitUnitTarget())
|
||||
{
|
||||
bIsItemSpellValid = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bIsItemSpellValid)
|
||||
{
|
||||
sLog->outErrorDb("Conditions: CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET for item %u, which either doesn't have item spelltrigger or its spells don't allow caster to select a unit target"
|
||||
", or the spells are already listed in CONDITION_SOURCE_TYPE_SPELL_SCRIPT_TARGET conditions.", cond->SourceEntry);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_SOURCE_TYPE_QUEST_ACCEPT:
|
||||
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
|
||||
{
|
||||
@@ -1163,6 +1074,9 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case CONDITION_SOURCE_TYPE_UNUSED_18:
|
||||
sLog->outErrorDb("Found SourceTypeOrReferenceId = CONDITION_SOURCE_TYPE_UNUSED_18 in `conditions` table - ignoring");
|
||||
return false;
|
||||
case CONDITION_SOURCE_TYPE_GOSSIP_MENU:
|
||||
case CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION:
|
||||
case CONDITION_SOURCE_TYPE_SMART_EVENT:
|
||||
@@ -1202,6 +1116,8 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
sLog->outErrorDb("Aura condition has non existing effect index (%u) (must be 0..2), skipped", cond->ConditionValue2);
|
||||
return false;
|
||||
}
|
||||
if (cond->ConditionValue3)
|
||||
sLog->outErrorDb("Aura condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_ITEM:
|
||||
@@ -1415,45 +1331,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONDITION_CREATURE_TARGET:
|
||||
{
|
||||
if (!cond->ConditionValue1 && !sObjectMgr->GetCreatureTemplate(cond->ConditionValue1))
|
||||
{
|
||||
sLog->outErrorDb("CreatureTarget condition has non existing creature template entry (%u) as target, skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cond->ConditionValue2)
|
||||
sLog->outErrorDb("CreatureTarget condition has useless data in value2 (%u)!", cond->ConditionValue2);
|
||||
if (cond->ConditionValue3)
|
||||
sLog->outErrorDb("CreatureTarget condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_TARGET_HEALTH_BELOW_PCT:
|
||||
{
|
||||
if (cond->ConditionValue1 > 100)
|
||||
{
|
||||
sLog->outErrorDb("TargetHealthBelowPct condition has invalid data in value1 (%u), skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cond->ConditionValue2)
|
||||
sLog->outErrorDb("TargetHealthBelowPct condition has useless data in value2 (%u)!", cond->ConditionValue2);
|
||||
if (cond->ConditionValue3)
|
||||
sLog->outErrorDb("TargetHealthBelowPct condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_TARGET_RANGE:
|
||||
{
|
||||
if (cond->ConditionValue2 && cond->ConditionValue2 < cond->ConditionValue1)//maxDist can be 0 for infinit max range
|
||||
{
|
||||
sLog->outErrorDb("TargetRange condition has max distance closer then min distance, skipped");
|
||||
return false;
|
||||
}
|
||||
if (cond->ConditionValue3)
|
||||
sLog->outErrorDb("TargetRange condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_MAPID:
|
||||
{
|
||||
MapEntry const* me = sMapStore.LookupEntry(cond->ConditionValue1);
|
||||
@@ -1469,24 +1346,6 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
sLog->outErrorDb("Map condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_ITEM_TARGET:
|
||||
{
|
||||
if (!cond->ConditionValue1 || cond->ConditionValue1 > MAX_ITEM_REQ_TARGET_TYPE)
|
||||
{
|
||||
sLog->outErrorDb("ItemTarget condition has incorrect target type (%u), skipped", cond->ConditionValue1);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!cond->ConditionValue2 && !sObjectMgr->GetCreatureTemplate(cond->ConditionValue2))
|
||||
{
|
||||
sLog->outErrorDb("ItemTarget condition has non existing creature template entry (%u) as target, skipped", cond->ConditionValue2);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (cond->ConditionValue3)
|
||||
sLog->outErrorDb("ItemTarget condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_SPELL:
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(cond->ConditionValue1))
|
||||
@@ -1712,6 +1571,18 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
sLog->outErrorDb("Phasemask condition has useless data in value3 (%u)!", cond->ConditionValue3);
|
||||
break;
|
||||
}
|
||||
case CONDITION_UNUSED_19:
|
||||
sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
|
||||
return false;
|
||||
case CONDITION_UNUSED_20:
|
||||
sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
|
||||
return false;
|
||||
case CONDITION_UNUSED_21:
|
||||
sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
|
||||
return false;
|
||||
case CONDITION_UNUSED_24:
|
||||
sLog->outErrorDb("Found ConditionTypeOrReference = CONDITION_UNUSED_19 in `conditions` table - ignoring");
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -49,12 +49,12 @@ enum ConditionTypes
|
||||
CONDITION_RACE = 16, // race 0 0 true if player's race is equal to race
|
||||
CONDITION_ACHIEVEMENT = 17, // achievement_id 0 0 true if achievement is complete
|
||||
CONDITION_SPELL_SCRIPT_TARGET = 18, // SpellScriptTargetType, TargetEntry, 0
|
||||
CONDITION_CREATURE_TARGET = 19, // creature entry 0 0 true if current target is creature with value1 entry
|
||||
CONDITION_TARGET_HEALTH_BELOW_PCT = 20, // 0-100 0 0 true if target's health is below value1 percent, false if over or no target
|
||||
CONDITION_TARGET_RANGE = 21, // minDistance maxDist 0 true if target is closer then minDist and further then maxDist or if max is 0 then max dist is infinit
|
||||
CONDITION_UNUSED_19 = 19, //
|
||||
CONDITION_UNUSED_20 = 20, //
|
||||
CONDITION_UNUSED_21 = 21, //
|
||||
CONDITION_MAPID = 22, // map_id 0 0 true if in map_id
|
||||
CONDITION_AREAID = 23, // area_id 0 0 true if in area_id
|
||||
CONDITION_ITEM_TARGET = 24, // ItemRequiredTargetType, TargetEntry, 0
|
||||
CONDITION_UNUSED_24 = 24, //
|
||||
CONDITION_SPELL = 25, // spell_id 0 0 true if player has learned spell
|
||||
CONDITION_PHASEMASK = 26, // phasemask 0 0 true if object is in phasemask
|
||||
CONDITION_LEVEL = 27, // level ComparisonType 0 true if unit's level is equal to param1 (param2 can modify the statement)
|
||||
@@ -92,7 +92,7 @@ enum ConditionSourceType
|
||||
CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION = 15,
|
||||
CONDITION_SOURCE_TYPE_CREATURE_TEMPLATE_VEHICLE = 16,
|
||||
CONDITION_SOURCE_TYPE_SPELL = 17,
|
||||
CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET = 18,
|
||||
CONDITION_SOURCE_TYPE_UNUSED_18 = 18,
|
||||
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19,
|
||||
CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20,
|
||||
CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21,
|
||||
@@ -255,10 +255,11 @@ template <class T> bool CompareValues(ComparisionType type, T val1, T val2)
|
||||
return val1 >= val2;
|
||||
case COMP_TYPE_LOW_EQ:
|
||||
return val1 <= val2;
|
||||
default:
|
||||
// incorrect parameter
|
||||
ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
// incorrect parameter
|
||||
ASSERT(false);
|
||||
return false;
|
||||
}
|
||||
|
||||
#define sConditionMgr ACE_Singleton<ConditionMgr, ACE_Null_Mutex>::instance()
|
||||
|
||||
@@ -145,7 +145,7 @@ m_PlayerDamageReq(0), m_lootMoney(0), m_lootRecipient(0), m_lootRecipientGroup(0
|
||||
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE),
|
||||
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_AlreadyCallAssistance(false),
|
||||
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
|
||||
m_creatureInfo(NULL), m_creatureData(NULL), m_formation(NULL), m_path_id(0)
|
||||
m_creatureInfo(NULL), m_creatureData(NULL), m_path_id(0), m_formation(NULL)
|
||||
{
|
||||
m_regenTimer = CREATURE_REGEN_INTERVAL;
|
||||
m_valuesCount = UNIT_END;
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "GameObjectModel.h"
|
||||
#include "DynamicTree.h"
|
||||
|
||||
GameObject::GameObject() : WorldObject(false), m_goValue(new GameObjectValue), m_AI(NULL), m_model(NULL)
|
||||
GameObject::GameObject() : WorldObject(false), m_model(NULL), m_goValue(new GameObjectValue), m_AI(NULL)
|
||||
{
|
||||
m_objectType |= TYPEMASK_GAMEOBJECT;
|
||||
m_objectTypeId = TYPEID_GAMEOBJECT;
|
||||
|
||||
@@ -870,24 +870,6 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Item::IsTargetValidForItemUse(Unit* pUnitTarget)
|
||||
{
|
||||
ConditionList conditions = sConditionMgr->GetConditionsForNotGroupedEntry(CONDITION_SOURCE_TYPE_ITEM_REQUIRED_TARGET, GetTemplate()->ItemId);
|
||||
if (conditions.empty())
|
||||
return true;
|
||||
|
||||
if (!pUnitTarget)
|
||||
return false;
|
||||
|
||||
for (ConditionList::const_iterator itr = conditions.begin(); itr != conditions.end(); ++itr)
|
||||
{
|
||||
ItemRequiredTarget irt(ItemRequiredTargetType((*itr)->ConditionValue1), (*itr)->ConditionValue2);
|
||||
if (irt.IsFitToRequirements(pUnitTarget))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Item::SetEnchantment(EnchantmentSlot slot, uint32 id, uint32 duration, uint32 charges)
|
||||
{
|
||||
// Better lost small time at check in comparison lost time at item save to DB.
|
||||
@@ -1092,25 +1074,6 @@ bool Item::IsBindedNotWith(Player const* player) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ItemRequiredTarget::IsFitToRequirements(Unit* pUnitTarget) const
|
||||
{
|
||||
if (pUnitTarget->GetTypeId() != TYPEID_UNIT)
|
||||
return false;
|
||||
|
||||
if (pUnitTarget->GetEntry() != m_uiTargetEntry)
|
||||
return false;
|
||||
|
||||
switch (m_uiType)
|
||||
{
|
||||
case ITEM_TARGET_TYPE_CREATURE:
|
||||
return pUnitTarget->isAlive();
|
||||
case ITEM_TARGET_TYPE_DEAD:
|
||||
return !pUnitTarget->isAlive();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Item::BuildUpdate(UpdateDataMapType& data_map)
|
||||
{
|
||||
if (Player* owner = GetOwner())
|
||||
|
||||
@@ -201,26 +201,8 @@ enum ItemUpdateState
|
||||
ITEM_REMOVED = 3
|
||||
};
|
||||
|
||||
enum ItemRequiredTargetType
|
||||
{
|
||||
ITEM_TARGET_TYPE_CREATURE = 1,
|
||||
ITEM_TARGET_TYPE_DEAD = 2
|
||||
};
|
||||
|
||||
#define MAX_ITEM_REQ_TARGET_TYPE 2
|
||||
|
||||
#define MAX_ITEM_SPELLS 5
|
||||
|
||||
struct ItemRequiredTarget
|
||||
{
|
||||
ItemRequiredTarget(ItemRequiredTargetType uiType, uint32 uiTargetEntry) : m_uiType(uiType), m_uiTargetEntry(uiTargetEntry) {}
|
||||
ItemRequiredTargetType m_uiType;
|
||||
uint32 m_uiTargetEntry;
|
||||
|
||||
// helpers
|
||||
bool IsFitToRequirements(Unit* pUnitTarget) const;
|
||||
};
|
||||
|
||||
bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto);
|
||||
|
||||
class Item : public Object
|
||||
@@ -268,7 +250,6 @@ class Item : public Object
|
||||
uint32 GetEnchantRequiredLevel() const;
|
||||
|
||||
bool IsFitToSpellRequirements(SpellInfo const* spellInfo) const;
|
||||
bool IsTargetValidForItemUse(Unit* pUnitTarget);
|
||||
bool IsLimitedToAnotherMapOrZone(uint32 cur_mapId, uint32 cur_zoneId) const;
|
||||
bool GemsFitSockets() const;
|
||||
|
||||
|
||||
@@ -434,9 +434,9 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/)
|
||||
// 5. Credit instance encounter.
|
||||
KillRewarder::KillRewarder(Player* killer, Unit* victim, bool isBattleGround) :
|
||||
// 1. Initialize internal variables to default values.
|
||||
_killer(killer), _victim(victim), _isBattleGround(isBattleGround),
|
||||
_isPvP(false), _group(killer->GetGroup()), _groupRate(1.0f),
|
||||
_maxLevel(0), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _isFullXP(false), _xp(0)
|
||||
_killer(killer), _victim(victim), _group(killer->GetGroup()),
|
||||
_groupRate(1.0f), _maxNotGrayMember(NULL), _count(0), _sumLevel(0), _xp(0),
|
||||
_isFullXP(false), _maxLevel(0), _isBattleGround(isBattleGround), _isPvP(false)
|
||||
{
|
||||
// mark the credit as pvp if victim is player
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -11830,7 +11830,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
|
||||
Map const* map = lootedObject->GetMap();
|
||||
if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true))
|
||||
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
|
||||
if (dungeon->map == map->GetId() && dungeon->difficulty == map->GetDifficulty())
|
||||
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty())
|
||||
lootedObjectInDungeon = true;
|
||||
|
||||
if (!lootedObjectInDungeon)
|
||||
@@ -12024,7 +12024,6 @@ Item* Player::StoreItem(ItemPosCountVec const& dest, Item* pItem, bool update)
|
||||
return NULL;
|
||||
|
||||
Item* lastItem = pItem;
|
||||
uint32 entry = pItem->GetEntry();
|
||||
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end();)
|
||||
{
|
||||
uint16 pos = itr->pos;
|
||||
|
||||
@@ -146,9 +146,10 @@ _hitMask(hitMask), _spell(spell), _damageInfo(damageInfo), _healInfo(healInfo)
|
||||
#endif
|
||||
Unit::Unit(bool isWorldObject): WorldObject(isWorldObject),
|
||||
m_movedPlayer(NULL), m_lastSanctuaryTime(0), IsAIEnabled(false), NeedChangeAI(false),
|
||||
m_ControlledByPlayer(false), i_AI(NULL), i_disabledAI(NULL), m_procDeep(0),
|
||||
m_removedAurasCount(0), i_motionMaster(this), m_ThreatManager(this), m_vehicle(NULL),
|
||||
m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE), m_HostileRefManager(this), movespline(new Movement::MoveSpline())
|
||||
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()), i_AI(NULL),
|
||||
i_disabledAI(NULL), m_procDeep(0), m_removedAurasCount(0), i_motionMaster(this),
|
||||
m_ThreatManager(this), m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
|
||||
m_HostileRefManager(this)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default:4355)
|
||||
@@ -7010,8 +7011,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
|
||||
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
|
||||
if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
|
||||
|| attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK
|
||||
|| attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
|
||||
|| (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
|
||||
|| (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK))
|
||||
return false;
|
||||
|
||||
// Now compute real proc chance...
|
||||
@@ -7307,8 +7308,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
|
||||
Player* player = ToPlayer();
|
||||
WeaponAttackType attType = WeaponAttackType(player->GetAttackBySlot(castItem->GetSlot()));
|
||||
if ((attType != BASE_ATTACK && attType != OFF_ATTACK)
|
||||
|| attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK
|
||||
|| attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK)
|
||||
|| (attType == BASE_ATTACK && procFlag & PROC_FLAG_DONE_OFFHAND_ATTACK)
|
||||
|| (attType == OFF_ATTACK && procFlag & PROC_FLAG_DONE_MAINHAND_ATTACK))
|
||||
return false;
|
||||
|
||||
float fire_onhit = float(CalculatePctF(dummySpell->Effects[EFFECT_0]. CalcValue(), 1.0f));
|
||||
@@ -12685,7 +12686,6 @@ void Unit::setDeathState(DeathState s)
|
||||
{
|
||||
// death state needs to be updated before RemoveAllAurasOnDeath() calls HandleChannelDeathItem(..) so that
|
||||
// it can be used to check creation of death items (such as soul shards).
|
||||
DeathState oldDeathState = m_deathState;
|
||||
m_deathState = s;
|
||||
|
||||
if (s != ALIVE && s != JUST_ALIVED)
|
||||
|
||||
@@ -63,7 +63,7 @@ struct VehicleSeat
|
||||
struct VehicleAccessory
|
||||
{
|
||||
VehicleAccessory(uint32 entry, int8 seatId, bool isMinion, uint8 summonType, uint32 summonTime) :
|
||||
AccessoryEntry(entry), SeatId(seatId), IsMinion(isMinion), SummonedType(summonType), SummonTime(summonTime) {}
|
||||
AccessoryEntry(entry), IsMinion(isMinion), SummonTime(summonTime), SeatId(seatId), SummonedType(summonType) {}
|
||||
uint32 AccessoryEntry;
|
||||
uint32 IsMinion;
|
||||
uint32 SummonTime;
|
||||
|
||||
@@ -554,7 +554,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
{
|
||||
Player* Leader = ObjectAccessor::FindPlayer(GetLeaderGUID());
|
||||
LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(sLFGMgr->GetDungeon(GetGUID()));
|
||||
if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != dungeon->map) || !dungeon)
|
||||
if ((Leader && dungeon && Leader->isAlive() && Leader->GetMapId() != uint32(dungeon->map)) || !dungeon)
|
||||
{
|
||||
Disband();
|
||||
return false;
|
||||
|
||||
@@ -165,24 +165,6 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
|
||||
targets.Read(recvPacket, pUser);
|
||||
HandleClientCastFlags(recvPacket, castFlags, targets);
|
||||
|
||||
if (!pItem->IsTargetValidForItemUse(targets.GetUnitTarget()))
|
||||
{
|
||||
// free gray item after use fail
|
||||
pUser->SendEquipError(EQUIP_ERR_NONE, pItem, NULL);
|
||||
|
||||
// send spell error
|
||||
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId))
|
||||
{
|
||||
// for implicit area/coord target spells
|
||||
if (!targets.GetUnitTarget())
|
||||
Spell::SendCastResult(_player, spellInfo, castCount, SPELL_FAILED_NO_VALID_TARGETS);
|
||||
// for explicit target spells
|
||||
else
|
||||
Spell::SendCastResult(_player, spellInfo, castCount, SPELL_FAILED_BAD_TARGETS);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Note: If script stop casting it must send appropriate data to client to prevent stuck item in gray state.
|
||||
if (!sScriptMgr->OnItemUse(pUser, pItem, targets))
|
||||
{
|
||||
|
||||
@@ -316,7 +316,7 @@ void InstanceScript::DoSendNotifyToInstance(char const* format, ...)
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
if (Player* player = i->getSource())
|
||||
if (WorldSession* session = player->GetSession())
|
||||
session->SendNotification(buff);
|
||||
session->SendNotification("%s", buff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1364,7 +1364,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
|
||||
{
|
||||
for (LootStoreItemList::iterator i = Entries.begin(); i != Entries.end(); ++i)
|
||||
{
|
||||
if (i->itemid == cond->SourceEntry)
|
||||
if (i->itemid == uint32(cond->SourceEntry))
|
||||
{
|
||||
i->conditions.push_back(cond);
|
||||
return true;
|
||||
@@ -1380,7 +1380,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
|
||||
{
|
||||
for (LootStoreItemList::iterator i = itemList->begin(); i != itemList->end(); ++i)
|
||||
{
|
||||
if ((*i).itemid == cond->SourceEntry)
|
||||
if ((*i).itemid == uint32(cond->SourceEntry))
|
||||
{
|
||||
(*i).conditions.push_back(cond);
|
||||
return true;
|
||||
@@ -1392,7 +1392,7 @@ bool LootTemplate::addConditionItem(Condition* cond)
|
||||
{
|
||||
for (LootStoreItemList::iterator i = itemList->begin(); i != itemList->end(); ++i)
|
||||
{
|
||||
if ((*i).itemid == cond->SourceEntry)
|
||||
if ((*i).itemid == uint32(cond->SourceEntry))
|
||||
{
|
||||
(*i).conditions.push_back(cond);
|
||||
return true;
|
||||
|
||||
@@ -666,10 +666,11 @@ void Map::RemovePlayerFromMap(Player* player, bool remove)
|
||||
ASSERT(remove); //maybe deleted in logoutplayer when player is not in a map
|
||||
|
||||
if (remove)
|
||||
{
|
||||
DeleteFromWorld(player);
|
||||
|
||||
if (remove)
|
||||
sScriptMgr->OnPlayerLeaveMap(this, player);
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -2374,7 +2375,7 @@ bool InstanceMap::AddPlayerToMap(Player* player)
|
||||
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
|
||||
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
|
||||
if (LFGDungeonEntry const* randomDungeon = sLFGDungeonStore.LookupEntry(*(sLFGMgr->GetSelectedDungeons(player->GetGUID()).begin())))
|
||||
if (dungeon->map == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM)
|
||||
if (uint32(dungeon->map) == GetId() && dungeon->difficulty == GetDifficulty() && randomDungeon->type == LFG_TYPE_RANDOM)
|
||||
player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class MotionMaster //: private std::stack<MovementGenerator *>
|
||||
void InitTop();
|
||||
public:
|
||||
|
||||
explicit MotionMaster(Unit* unit) : _top(-1), _owner(unit), _expList(NULL), _cleanFlag(MMCF_NONE)
|
||||
explicit MotionMaster(Unit* unit) : _expList(NULL), _top(-1), _owner(unit), _cleanFlag(MMCF_NONE)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
|
||||
{
|
||||
|
||||
@@ -57,7 +57,7 @@ void HomeMovementGenerator<Creature>::_setTargetLocation(Creature & owner)
|
||||
owner.ClearUnitState(UNIT_STATE_ALL_STATE & ~UNIT_STATE_EVADE);
|
||||
}
|
||||
|
||||
bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 time_diff)
|
||||
bool HomeMovementGenerator<Creature>::Update(Creature &owner, const uint32 /*time_diff*/)
|
||||
{
|
||||
arrived = owner.movespline->Finalized();
|
||||
return !arrived;
|
||||
|
||||
@@ -41,7 +41,7 @@ void PointMovementGenerator<T>::Initialize(T &unit)
|
||||
}
|
||||
|
||||
template<class T>
|
||||
bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
||||
bool PointMovementGenerator<T>::Update(T &unit, const uint32 & /*diff*/)
|
||||
{
|
||||
if (!&unit)
|
||||
return false;
|
||||
|
||||
@@ -35,9 +35,8 @@
|
||||
template<>
|
||||
void RandomMovementGenerator<Creature>::_setRandomLocation(Creature& creature)
|
||||
{
|
||||
float respX, respY, respZ, respO, currZ, destX, destY, destZ, travelDistZ;
|
||||
float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ;
|
||||
creature.GetHomePosition(respX, respY, respZ, respO);
|
||||
currZ = creature.GetPositionZ();
|
||||
Map const* map = creature.GetBaseMap();
|
||||
|
||||
// For 2D/3D system selection
|
||||
|
||||
@@ -39,8 +39,9 @@ class TargetedMovementGeneratorMedium
|
||||
{
|
||||
protected:
|
||||
TargetedMovementGeneratorMedium(Unit &target, float offset, float angle) :
|
||||
TargetedMovementGeneratorBase(target), i_offset(offset), i_angle(angle),
|
||||
i_recalculateTravel(false), i_targetReached(false), i_recheckDistance(0)
|
||||
TargetedMovementGeneratorBase(target), i_recheckDistance(0),
|
||||
i_offset(offset), i_angle(angle),
|
||||
i_recalculateTravel(false), i_targetReached(false)
|
||||
{
|
||||
}
|
||||
~TargetedMovementGeneratorMedium() {}
|
||||
|
||||
@@ -78,7 +78,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
|
||||
|
||||
if (i_path->at(i_currentNode)->event_id && urand(0, 99) < i_path->at(i_currentNode)->event_chance)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for %u.", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID());
|
||||
sLog->outDebug(LOG_FILTER_MAPSCRIPTS, "Creature movement start script %u at point %u for "UI64FMTD".", i_path->at(i_currentNode)->event_id, i_currentNode, creature.GetGUID());
|
||||
creature.GetMap()->ScriptsStart(sWaypointScripts, i_path->at(i_currentNode)->event_id, &creature, NULL/*, false*/);
|
||||
}
|
||||
|
||||
@@ -201,20 +201,17 @@ void FlightPathMovementGenerator::Initialize(Player &player)
|
||||
InitEndGridInfo();
|
||||
}
|
||||
|
||||
void FlightPathMovementGenerator::Finalize(Player & player)
|
||||
void FlightPathMovementGenerator::Finalize(Player& player)
|
||||
{
|
||||
// remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
|
||||
player.ClearUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
|
||||
player.Dismount();
|
||||
player.RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
player.RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
|
||||
if(player.m_taxi.empty())
|
||||
if (player.m_taxi.empty())
|
||||
{
|
||||
player.getHostileRefManager().setOnlineOfflineState(true);
|
||||
if(player.pvpInfo.inHostileArea)
|
||||
player.CastSpell(&player, 2479, true);
|
||||
|
||||
// update z position to ground and orientation for landing point
|
||||
// this prevent cheating with landing point at lags
|
||||
// when client side flight end early in comparison server side
|
||||
@@ -243,7 +240,7 @@ void FlightPathMovementGenerator::Reset(Player & player)
|
||||
init.Launch();
|
||||
}
|
||||
|
||||
bool FlightPathMovementGenerator::Update(Player &player, const uint32 diff)
|
||||
bool FlightPathMovementGenerator::Update(Player &player, const uint32 /*diff*/)
|
||||
{
|
||||
uint32 pointId = (uint32)player.movespline->currentPathIdx();
|
||||
if (pointId > i_currentNode)
|
||||
|
||||
@@ -42,7 +42,7 @@ template<class T, class P>
|
||||
class PathMovementBase
|
||||
{
|
||||
public:
|
||||
PathMovementBase() : i_currentNode(0), i_path(NULL) {}
|
||||
PathMovementBase() : i_path(NULL), i_currentNode(0) {}
|
||||
virtual ~PathMovementBase() {};
|
||||
|
||||
// template pattern, not defined .. override required
|
||||
@@ -63,7 +63,8 @@ class WaypointMovementGenerator<Creature>
|
||||
public PathMovementBase<Creature, WaypointPath const*>
|
||||
{
|
||||
public:
|
||||
WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true) : i_nextMoveTime(0), path_id(_path_id), m_isArrivalDone(false), repeating(_repeating) {}
|
||||
WaypointMovementGenerator(uint32 _path_id = 0, bool _repeating = true)
|
||||
: i_nextMoveTime(0), m_isArrivalDone(false), path_id(_path_id), repeating(_repeating) {}
|
||||
~WaypointMovementGenerator() { i_path = NULL; }
|
||||
void Initialize(Creature &);
|
||||
void Finalize(Creature &);
|
||||
|
||||
@@ -187,7 +187,7 @@ void MoveSpline::Initialize(const MoveSplineInitArgs& args)
|
||||
}
|
||||
|
||||
MoveSpline::MoveSpline() : m_Id(0), time_passed(0),
|
||||
vertical_acceleration(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0), initialOrientation(0.f)
|
||||
vertical_acceleration(0.f), initialOrientation(0.f), effect_start_time(0), point_Idx(0), point_Idx_offset(0)
|
||||
{
|
||||
splineflags.done = true;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,6 @@ namespace Movement
|
||||
Result_NextCycle = 0x04,
|
||||
Result_NextSegment = 0x08,
|
||||
};
|
||||
#pragma region fields
|
||||
friend class PacketBuilder;
|
||||
protected:
|
||||
MySpline spline;
|
||||
@@ -88,7 +87,6 @@ namespace Movement
|
||||
void _Finalize();
|
||||
void _Interrupt() { splineflags.done = true;}
|
||||
|
||||
#pragma endregion
|
||||
public:
|
||||
|
||||
void Initialize(const MoveSplineInitArgs&);
|
||||
|
||||
@@ -98,14 +98,14 @@ namespace Movement
|
||||
void operator &= (uint32 f) { raw() &= f;}
|
||||
void operator |= (uint32 f) { raw() |= f;}
|
||||
|
||||
void EnableAnimation(uint8 anim) { raw() = raw() & ~(Mask_Animations|Falling|Parabolic) | Animation|anim;}
|
||||
void EnableParabolic() { raw() = raw() & ~(Mask_Animations|Falling|Animation) | Parabolic;}
|
||||
void EnableFalling() { raw() = raw() & ~(Mask_Animations|Parabolic|Animation) | Falling;}
|
||||
void EnableFlying() { raw() = raw() & ~Catmullrom | Flying; }
|
||||
void EnableCatmullRom() { raw() = raw() & ~Flying | Catmullrom; }
|
||||
void EnableFacingPoint() { raw() = raw() & ~Mask_Final_Facing | Final_Point;}
|
||||
void EnableFacingAngle() { raw() = raw() & ~Mask_Final_Facing | Final_Angle;}
|
||||
void EnableFacingTarget() { raw() = raw() & ~Mask_Final_Facing | Final_Target;}
|
||||
void EnableAnimation(uint8 anim) { raw() = (raw() & ~(Mask_Animations|Falling|Parabolic)) | Animation|anim;}
|
||||
void EnableParabolic() { raw() = (raw() & ~(Mask_Animations|Falling|Animation)) | Parabolic;}
|
||||
void EnableFalling() { raw() = (raw() & ~(Mask_Animations|Parabolic|Animation)) | Falling;}
|
||||
void EnableFlying() { raw() = (raw() & ~Catmullrom) | Flying; }
|
||||
void EnableCatmullRom() { raw() = (raw() & ~Flying) | Catmullrom; }
|
||||
void EnableFacingPoint() { raw() = (raw() & ~Mask_Final_Facing) | Final_Point;}
|
||||
void EnableFacingAngle() { raw() = (raw() & ~Mask_Final_Facing) | Final_Angle;}
|
||||
void EnableFacingTarget() { raw() = (raw() & ~Mask_Final_Facing) | Final_Target;}
|
||||
|
||||
uint8 animId : 8;
|
||||
bool done : 1;
|
||||
|
||||
@@ -56,7 +56,6 @@ SplineBase::InitMethtod SplineBase::initializers[SplineBase::ModesEnd] =
|
||||
};
|
||||
|
||||
///////////
|
||||
#pragma region evaluation methtods
|
||||
|
||||
using G3D::Matrix4;
|
||||
static const Matrix4 s_catmullRomCoeffs(
|
||||
@@ -199,7 +198,6 @@ float SplineBase::SegLengthBezier3(index_type index) const
|
||||
}
|
||||
return length;
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
void SplineBase::init_spline(const Vector3 * controls, index_type count, EvaluationMode m)
|
||||
{
|
||||
|
||||
@@ -39,7 +39,6 @@ public:
|
||||
ModesEnd
|
||||
};
|
||||
|
||||
#pragma region fields
|
||||
protected:
|
||||
ControlArray points;
|
||||
|
||||
@@ -84,10 +83,9 @@ protected:
|
||||
|
||||
void UninitializedSpline() const { ASSERT(false);}
|
||||
|
||||
#pragma endregion
|
||||
public:
|
||||
|
||||
explicit SplineBase() : m_mode(UninitializedMode), index_lo(0), index_hi(0), cyclic(false) {}
|
||||
explicit SplineBase() : index_lo(0), index_hi(0), m_mode(UninitializedMode), cyclic(false) {}
|
||||
|
||||
/** Caclulates the position for given segment Idx, and percent of segment length t
|
||||
@param t - percent of segment length, assumes that t in range [0, 1]
|
||||
@@ -138,13 +136,11 @@ class Spline : public SplineBase
|
||||
public:
|
||||
typedef length_type LengthType;
|
||||
typedef std::vector<length_type> LengthArray;
|
||||
#pragma region fields
|
||||
protected:
|
||||
|
||||
LengthArray lengths;
|
||||
|
||||
index_type computeIndexInBounds(length_type length) const;
|
||||
#pragma endregion
|
||||
public:
|
||||
|
||||
explicit Spline(){}
|
||||
|
||||
@@ -360,7 +360,7 @@ class Quest
|
||||
|
||||
struct QuestStatusData
|
||||
{
|
||||
QuestStatusData(): Status(QUEST_STATUS_NONE), Explored(false), Timer(0), PlayerCount(0)
|
||||
QuestStatusData(): Status(QUEST_STATUS_NONE), Timer(0), PlayerCount(0), Explored(false)
|
||||
{
|
||||
memset(ItemCount, 0, QUEST_ITEM_OBJECTIVES_COUNT * sizeof(uint16));
|
||||
memset(CreatureOrGOCount, 0, QUEST_OBJECTIVES_COUNT * sizeof(uint16));
|
||||
|
||||
@@ -373,10 +373,10 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
|
||||
};
|
||||
|
||||
AuraEffect::AuraEffect(Aura* base, uint8 effIndex, int32 *baseAmount, Unit* caster):
|
||||
m_base(base), m_spellInfo(base->GetSpellInfo()), m_effIndex(effIndex),
|
||||
m_base(base), m_spellInfo(base->GetSpellInfo()),
|
||||
m_baseAmount(baseAmount ? *baseAmount : m_spellInfo->Effects[m_effIndex].BasePoints),
|
||||
m_canBeRecalculated(true), m_spellmod(NULL), m_isPeriodic(false),
|
||||
m_periodicTimer(0), m_tickNumber(0)
|
||||
m_spellmod(NULL), m_periodicTimer(0), m_tickNumber(0), m_effIndex(effIndex),
|
||||
m_canBeRecalculated(true), m_isPeriodic(false)
|
||||
{
|
||||
CalculatePeriodic(caster, true, false);
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
#include "Vehicle.h"
|
||||
|
||||
AuraApplication::AuraApplication(Unit* target, Unit* caster, Aura* aura, uint8 effMask):
|
||||
_target(target), _base(aura), _slot(MAX_AURAS), _flags(AFLAG_NONE),
|
||||
_effectsToApply(effMask), _removeMode(AURA_REMOVE_NONE), _needClientUpdate(false)
|
||||
_target(target), _base(aura), _removeMode(AURA_REMOVE_NONE), _slot(MAX_AURAS),
|
||||
_flags(AFLAG_NONE), _effectsToApply(effMask), _needClientUpdate(false)
|
||||
{
|
||||
ASSERT(GetTarget() && GetBase());
|
||||
|
||||
|
||||
@@ -4651,7 +4651,7 @@ SpellCastResult Spell::CheckCast(bool strict)
|
||||
|
||||
Unit::AuraEffectList const& blockSpells = m_caster->GetAuraEffectsByType(SPELL_AURA_BLOCK_SPELL_FAMILY);
|
||||
for (Unit::AuraEffectList::const_iterator blockItr = blockSpells.begin(); blockItr != blockSpells.end(); ++blockItr)
|
||||
if ((*blockItr)->GetMiscValue() == m_spellInfo->SpellFamilyName)
|
||||
if (uint32((*blockItr)->GetMiscValue()) == m_spellInfo->SpellFamilyName)
|
||||
return SPELL_FAILED_SPELL_UNAVAILABLE;
|
||||
|
||||
bool reqCombat = true;
|
||||
|
||||
@@ -1042,7 +1042,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleDebugLoSCommand(ChatHandler* handler, char const* args)
|
||||
static bool HandleDebugLoSCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
if (Unit* unit = handler->getSelectedUnit())
|
||||
handler->PSendSysMessage("Unit %s (GuidLow: %u) is %sin LoS", unit->GetName(), unit->GetGUIDLow(), handler->GetSession()->GetPlayer()->IsWithinLOSInMap(unit) ? "" : "not ");
|
||||
|
||||
+6
-4
@@ -308,7 +308,7 @@ struct boss_twin_baseAI : public ScriptedAI
|
||||
|
||||
void EnableDualWield(bool mode = true)
|
||||
{
|
||||
SetEquipmentSlots(false, m_uiWeapon, mode ? m_uiWeapon : EQUIP_UNEQUIP, EQUIP_UNEQUIP);
|
||||
SetEquipmentSlots(false, m_uiWeapon, mode ? m_uiWeapon : int32(EQUIP_UNEQUIP), EQUIP_UNEQUIP);
|
||||
me->SetCanDualWield(mode);
|
||||
me->UpdateDamagePhysical(mode ? OFF_ATTACK : BASE_ATTACK);
|
||||
}
|
||||
@@ -562,11 +562,13 @@ struct mob_unleashed_ballAI : public ScriptedAI
|
||||
{
|
||||
float x0 = ToCCommonLoc[1].GetPositionX(), y0 = ToCCommonLoc[1].GetPositionY(), r = 47.0f;
|
||||
float y = y0;
|
||||
float x = float(urand(uint32(x0 - r), uint32(x0 + r)));
|
||||
float x = frand(x0 - r, x0 + r);
|
||||
float sq = pow(r, 2) - pow(x - x0, 2);
|
||||
float rt = sqrtf(fabs(sq));
|
||||
if (urand(0, 1))
|
||||
y = y0 + sqrt(pow(r, 2) - pow((x-x0), 2));
|
||||
y = y0 + rt;
|
||||
else
|
||||
y = y0 - sqrt(pow(r, 2) - pow((x-x0), 2));
|
||||
y = y0 - rt;
|
||||
me->GetMotionMaster()->MovePoint(0, x, y, me->GetPositionZ());
|
||||
}
|
||||
|
||||
|
||||
@@ -289,7 +289,7 @@ class spell_trash_mob_glacial_strike : public SpellScriptLoader
|
||||
{
|
||||
if (GetTarget()->IsFullHealth())
|
||||
{
|
||||
GetTarget()->RemoveAura(GetId(), AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
GetTarget()->RemoveAura(GetId(), 0, 0, AURA_REMOVE_BY_ENEMY_SPELL);
|
||||
PreventDefaultAction();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -739,7 +739,7 @@ class npc_simon_bunny : public CreatureScript
|
||||
if (!listening)
|
||||
return;
|
||||
|
||||
uint8 pressedColor;
|
||||
uint8 pressedColor = SIMON_MAX_COLORS;
|
||||
|
||||
if (type == clusterIds[SIMON_RED])
|
||||
pressedColor = SIMON_RED;
|
||||
@@ -974,7 +974,7 @@ class npc_simon_bunny : public CreatureScript
|
||||
// Handles the spell rewards. The spells also have the QuestCompleteEffect, so quests credits are working.
|
||||
void GiveRewardForLevel(uint8 level)
|
||||
{
|
||||
uint32 rewSpell;
|
||||
uint32 rewSpell = 0;
|
||||
switch (level)
|
||||
{
|
||||
case 6:
|
||||
@@ -989,8 +989,6 @@ class npc_simon_bunny : public CreatureScript
|
||||
case 10:
|
||||
rewSpell = SPELL_REWARD_BUFF_3;
|
||||
break;
|
||||
default:
|
||||
rewSpell = 0;
|
||||
}
|
||||
|
||||
if (rewSpell)
|
||||
|
||||
@@ -1507,7 +1507,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
|
||||
|
||||
const LfgDungeonSet dungeons = sLFGMgr->GetSelectedDungeons(GetUnitOwner()->GetGUID());
|
||||
LfgDungeonSet::const_iterator itr = dungeons.begin();
|
||||
|
||||
|
||||
if (itr == dungeons.end())
|
||||
{
|
||||
Remove(AURA_REMOVE_BY_DEFAULT);
|
||||
@@ -1521,7 +1521,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
|
||||
if (group && group->isLFGGroup())
|
||||
if (uint32 dungeonId = sLFGMgr->GetDungeon(group->GetGUID(), true))
|
||||
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
|
||||
if (dungeon->map == map->GetId() && dungeon->difficulty == map->GetDifficulty())
|
||||
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == map->GetDifficulty())
|
||||
if (randomDungeon && randomDungeon->type == LFG_TYPE_RANDOM)
|
||||
return; // in correct dungeon
|
||||
|
||||
@@ -1706,6 +1706,8 @@ class spell_gen_break_shield: public SpellScriptLoader
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1794,6 +1796,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader
|
||||
{
|
||||
case SPELL_CHARGE_TRIGGER_TRIAL_CHAMPION:
|
||||
spellId = SPELL_CHARGE_CHARGING_EFFECT_20K_1;
|
||||
break;
|
||||
case SPELL_CHARGE_TRIGGER_FACTION_MOUNTS:
|
||||
spellId = SPELL_CHARGE_CHARGING_EFFECT_8K5;
|
||||
break;
|
||||
@@ -1834,7 +1837,7 @@ class spell_gen_mounted_charge: public SpellScriptLoader
|
||||
}
|
||||
}
|
||||
|
||||
void HandleChargeEffect(SpellEffIndex effIndex)
|
||||
void HandleChargeEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
uint32 spellId;
|
||||
|
||||
@@ -1908,7 +1911,7 @@ class spell_gen_defend : public SpellScriptLoader
|
||||
|
||||
void RefreshVisualShields(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (GetCaster())
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
@@ -1989,7 +1992,7 @@ class spell_gen_tournament_duel : public SpellScriptLoader
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* rider = GetCaster()->GetCharmer())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user