Permalink
Browse files

[s1415] Implement jump (parabolic movement) effect

Partly backported

(based on commit bc2ef4b)
(based on commit 873cab6)
  • Loading branch information...
1 parent d888abe commit 49f98ac81bdf5fd36cd13cea7e1ba77d4e30b2b2 @SilverIce SilverIce committed with stfx Oct 17, 2011
View
@@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` (
`version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL,
- `required_s1413_11827_01_mangos_creature_linking_template` bit(1) default NULL
+ `required_s1415_11754_01_mangos_mangos_string` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
--
@@ -3480,6 +3480,7 @@ INSERT INTO `mangos_string` VALUES
(535,' Home movement to (X:%f Y:%f Z:%f)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(536,' Home movement used for player?!?',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(537,' Taxi flight',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
+(1192,' Effect movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(538,' Unknown movement generator (%u)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(539,'Player selected: %s.\nFaction: %u.\nnpcFlags: %u.\nEntry: %u.\nDisplayID: %u (Native: %u).',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(540,'Level: %u.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
@@ -0,0 +1,5 @@
+ALTER TABLE db_version CHANGE COLUMN required_s1413_11827_01_mangos_creature_linking_template required_s1415_11754_01_mangos_mangos_string bit;
+
+DELETE FROM mangos_string WHERE entry IN (1192);
+
+INSERT INTO mangos_string VALUES (1192,'Effect movement',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
View
@@ -934,7 +934,8 @@ enum MangosStrings
LANG_AHBOT_QUALITY_YELLOW = 1189,
LANG_AHBOT_ITEMS_AMOUNT = 1190,
LANG_AHBOT_ITEMS_RATIO = 1191,
- // Room for more level 3 1192-1199 not used
+ LANG_MOVEGENS_EFFECT = 1192,
+ // Room for more level 3 1193-1199 not used
// Debug commands
LANG_CINEMATIC_NOT_EXIST = 1200,
View
@@ -5666,6 +5666,7 @@ bool ChatHandler::HandleMovegensCommand(char* /*args*/)
}
case FLEEING_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_FEAR); break;
case DISTRACT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_DISTRACT); break;
+ case EFFECT_MOTION_TYPE: SendSysMessage(LANG_MOVEGENS_EFFECT); break;
default:
PSendSysMessage(LANG_MOVEGENS_UNKNOWN,(*itr)->GetMovementGeneratorType());
break;
View
@@ -48,6 +48,7 @@ enum MovementGeneratorType
ASSISTANCE_DISTRACT_MOTION_TYPE = 12, // IdleMovementGenerator.h (second part of flee for assistance)
TIMED_FLEEING_MOTION_TYPE = 13, // FleeingMovementGenerator.h (alt.second part of flee for assistance)
FOLLOW_MOTION_TYPE = 14, // TargetedMovementGenerator.h
+ EFFECT_MOTION_TYPE = 15,
};
enum MMCleanFlag
@@ -119,3 +119,25 @@ void AssistanceMovementGenerator::Finalize(Unit &unit)
if (unit.isAlive())
unit.GetMotionMaster()->MoveSeekAssistanceDistract(sWorld.getConfig(CONFIG_UINT32_CREATURE_FAMILY_ASSISTANCE_DELAY));
}
+
+bool EffectMovementGenerator::Update(Unit &unit, const uint32 &)
+{
+ return !unit.movespline->Finalized();
+}
+
+void EffectMovementGenerator::Finalize(Unit &unit)
+{
+ if (unit.GetTypeId() != TYPEID_UNIT)
+ return;
+
+ if (((Creature&)unit).AI() && unit.movespline->Finalized())
+ ((Creature&)unit).AI()->MovementInform(EFFECT_MOTION_TYPE, m_Id);
+ // Need restore previous movement since we have no proper states system
+ if (unit.isAlive() && !unit.hasUnitState(UNIT_STAT_CONFUSED|UNIT_STAT_FLEEING))
+ {
+ if (Unit * victim = unit.getVictim())
+ unit.GetMotionMaster()->MoveChase(victim);
+ else
+ unit.GetMotionMaster()->Initialize();
+ }
+}
@@ -58,4 +58,19 @@ class MANGOS_DLL_SPEC AssistanceMovementGenerator
void Finalize(Unit &);
};
+// Does almost nothing - just doesn't allows previous movegen interrupt current effect. Can be reused for charge effect
+class EffectMovementGenerator : public MovementGenerator
+{
+ public:
+ explicit EffectMovementGenerator(uint32 Id) : m_Id(Id) {}
+ void Initialize(Unit &) {}
+ void Finalize(Unit &unit);
+ void Interrupt(Unit &) {}
+ void Reset(Unit &) {}
+ bool Update(Unit &u, const uint32 &);
+ MovementGeneratorType GetMovementGeneratorType() const { return EFFECT_MOTION_TYPE; }
+ private:
+ uint32 m_Id;
+};
+
#endif
@@ -73,6 +73,9 @@ namespace Movement
};
typedef counter<uint32, 0xFFFFFFFF> UInt32Counter;
+
+ extern double gravity;
+ extern float computeFallElevation(float t_passed, bool isSafeFall, float start_velocity);
}
#endif // MANGOSSERVER_TYPEDEFS_H
View
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
- #define REVISION_NR "1414"
+ #define REVISION_NR "1415"
#endif // __REVISION_NR_H__
@@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_s1350_11716_09_characters_mail"
- #define REVISION_DB_MANGOS "required_s1413_11827_01_mangos_creature_linking_template"
+ #define REVISION_DB_MANGOS "required_s1415_11754_01_mangos_mangos_string"
#define REVISION_DB_REALMD "required_10008_01_realmd_realmd_db_version"
#endif // __REVISION_SQL_H__

0 comments on commit 49f98ac

Please sign in to comment.