*Correctly show spellclick flag for vehicles and creatures with info in spellclick table.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-08 23:43:25 -05:00
parent 30adb32d53
commit a8dbf8904c
7 changed files with 20 additions and 17 deletions
+1 -1
View File
@@ -1524,7 +1524,7 @@ bool ChatHandler::HandleModifyASpeedCommand(const char* args)
float ASpeed = (float)atof((char*)args);
if (ASpeed > 10 || ASpeed < 0.1)
if (ASpeed > 50 || ASpeed < 0)
{
SendSysMessage(LANG_BAD_VALUE);
SetSentErrorMessage(true);
+3
View File
@@ -6467,6 +6467,9 @@ void ObjectMgr::LoadNPCSpellClickSpells()
continue;
}
if(!(cInfo->npcflag & UNIT_NPC_FLAG_SPELLCLICK))
const_cast<CreatureInfo*>(cInfo)->npcflag |= UNIT_NPC_FLAG_SPELLCLICK;
uint32 spellid = fields[1].GetUInt32();
SpellEntry const *spellinfo = sSpellStore.LookupEntry(spellid);
if (!spellinfo)
+4
View File
@@ -17437,6 +17437,10 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
// stop combat at start taxi flight if any
CombatStop();
StopCastingCharm();
StopCastingBindSight();
ExitVehicle();
// stop trade (client cancel trade at taxi map open but cheating tools can be used for reopen it)
TradeCancel(true);
+6 -7
View File
@@ -3879,10 +3879,9 @@ void AuraEffect::HandleAuraModDisarm(bool apply, bool Real, bool /*changeAmount*
AuraType type = AuraType(GetAuraName());
//Prevent handling aura twice
if(apply && m_target->GetAurasByType(type).size()>1)
return;
if(!apply && m_target->HasAuraType(type))
if(apply ? m_target->GetAurasByType(type).size() > 1 : m_target->HasAuraType(type))
return;
uint32 field, flag, slot;
WeaponAttackType attType;
switch (type)
@@ -3905,6 +3904,8 @@ void AuraEffect::HandleAuraModDisarm(bool apply, bool Real, bool /*changeAmount*
slot=EQUIPMENT_SLOT_RANGED;
attType=RANGED_ATTACK;
break;
default:
return;
}
if(apply)
m_target->SetFlag(field, flag);
@@ -3913,10 +3914,8 @@ void AuraEffect::HandleAuraModDisarm(bool apply, bool Real, bool /*changeAmount*
if (m_target->GetTypeId() == TYPEID_PLAYER)
{
Item *pItem = ((Player*)m_target)->GetItemByPos( INVENTORY_SLOT_BAG_0, slot );
if(!pItem )
return;
((Player*)m_target)->_ApplyItemMods(pItem, slot, !apply);
if(Item *pItem = ((Player*)m_target)->GetItemByPos( INVENTORY_SLOT_BAG_0, slot ))
((Player*)m_target)->_ApplyItemMods(pItem, slot, !apply);
}
else if (((Creature*)m_target)->GetCurrentEquipmentId())
m_target->UpdateDamagePhysical(attType);
+1 -3
View File
@@ -3393,10 +3393,8 @@ void Spell::EffectSummonType(uint32 i)
vehicle->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
if(damage)
{
m_caster->CastSpell(vehicle, damage, true);
m_caster->EnterVehicle(vehicle);
}
m_caster->EnterVehicle(vehicle);
break;
}
}
-1
View File
@@ -13618,7 +13618,6 @@ void Unit::SetCharmedBy(Unit* charmer, CharmType type)
if(GetTypeId() == TYPEID_UNIT)
{
((Creature*)this)->AI()->OnCharmed(true);
GetMotionMaster()->Clear(false);
GetMotionMaster()->MoveIdle();
}
else
+5 -5
View File
@@ -24,7 +24,6 @@
#include "Util.h"
#include "WorldPacket.h"
#include "Chat.h"
#include "CreatureAI.h"
#include "ZoneScript.h"
@@ -85,6 +84,11 @@ void Vehicle::setDeathState(DeathState s) // overwrite vir
}
RemoveAllPassengers();
}
else if(s == JUST_ALIVED)
{
if(m_usableSeatNum)
SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
}
Creature::setDeathState(s);
}
@@ -244,13 +248,9 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
GetPositionZ() + unit->m_movementInfo.t_z,
GetOrientation());
unit->GetMotionMaster()->MoveIdle(MOTION_SLOT_IDLE);
WorldPacket data;
if(unit->GetTypeId() == TYPEID_PLAYER)
{
//ChatHandler(player).PSendSysMessage("Enter seat %u %u", veSeat->m_ID, seat->first);
if(seat->first == 0 && seat->second.seatInfo->IsUsable()) // not right
SetCharmedBy(unit, CHARM_TYPE_VEHICLE);