aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
author_manuel_ <none@none>2009-12-31 17:59:56 -0300
committer_manuel_ <none@none>2009-12-31 17:59:56 -0300
commitebe7b299877aad8954bb5ab32d4046800c49b293 (patch)
treeecbd1b704d3261da65a424f091583c7c8943640f /src/game/Unit.cpp
parent6cd8d1286f48671cd2e782b3a6803d7e951cb0f5 (diff)
Implemented function CheckPlayerCondition, it will be used before the player enters in vehicles. Now vehicles Argent Warhorse and Argent Battleworg can't be used if the player dosen't have Argent Lance eqquiped.
--HG-- branch : trunk
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 04214762148..a9dbcab3db6 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -15420,6 +15420,19 @@ void Unit::JumpTo(WorldObject *obj, float speedZ)
GetMotionMaster()->MoveJump(x, y, z, speedXY, speedZ);
}
+bool Unit::CheckPlayerCondition(Player* pPlayer)
+{
+ switch(GetEntry())
+ {
+ case 35644: //Argent Warhorse
+ case 36558: //Argent Battleworg
+ if (!pPlayer->HasItemOrGemWithIdEquipped(46106,1)) //Check item Argent Lance
+ return false;
+ default:
+ return true;
+ }
+}
+
void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId)
{
if (!isAlive() || GetVehicleKit() == vehicle)