Modcraft - The community dedicated to quality WoW modding!
Wrath of the Lich King Modding => Miscellaneous => Topic started by: Piccolodmq on February 27, 2017, 10:28:47 pm
-
Hi there
I want to make an NPC that when attack it will hold position (like a cannon) and attack me from its position,
I know this is something fairly simple and in the past I have done it by just editing the unit flags to 4, but its just not working with the current trinitycore version.
Here is the the full SQL
-- FULL `creature_template` of entry 80269
DELETE FROM `creature_template` WHERE (entry = 80269);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `spell5`, `spell6`, `spell7`, `spell8`, `PetSpellDataId`, `VehicleId`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `HoverHeight`, `HealthModifier`, `ManaModifier`, `ArmorModifier`, `DamageModifier`, `ExperienceModifier`, `RacialLeader`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(80269, 0, 0, 0, 0, 0, 147047, 0, 0, 0, 'Fel Soulstone', '', NULL, 0, 80, 80, 0, 189, 0, 1, 1.14286, 1, 0, 0, 2000, 2000, 1, 1, 1, 4, 2048, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 10, 0, 0, 0, 40, 10, 0, 0, 0, 0, 0, 0, 0, 0, 9085, 0, 0, 0, 'SmartAI', 0, 1, 1, 3, 1, 1, 1, 1, 0, 0, 1, 0, 2, '', 12340);
I have even tried to copy npc´s in game that wont move when attack (like fel cannons from outland ID=)22461, and change the ID, and still... when I attack the NPC it will follow me everywhere. I want it to attack me holding its position.
thanks!
-
The easiest way I am aware of is using SmartAI. On update in combat, set its combat movement to 0. On update out of combat, set its combat movement to 1, so its able to move if it has any kind of waypoints or whatever (I am unsure wheter this was really needed, but I think it was). Done.
-
I just have one question... how do you know so much random stuff. hahhaha that did it!
-
It has been over 5 years since I have started working with TDB :D. And as I needed archer NPCs, I needed to find out how to make them work.
-
Piccolodmq for getting stationary NPC, you need set him MovementType to 0 not in "creature_темплате" , but only in "creature" table, for each spawned NPC's.
Of course, you need teach him a range spell (with no cost)
Also it is desirable to enabled vmaps/mmaps.
-
O right, thank you. This works as well