Skip to content

Instantly share code, notes, and snippets.

@Naios
Last active August 29, 2015 14:11
Show Gist options
  • Save Naios/634b0bfbc04e56165f96 to your computer and use it in GitHub Desktop.
Save Naios/634b0bfbc04e56165f96 to your computer and use it in GitHub Desktop.
WIde example query output
SET @CLASS_ROGUE := 2;
SET @CREDIT_CUSTOM_VARIABLE := 123456;
SET @NPC_DISEASED_TIMBER_WOLF := 69;
SET @NPC_HARVEST_REAPER := 115;
SET @NPC_BANDIT := 116;
SET @NPC_RIVERPAW_GNOLL := 117;
SET @NPC_PROWLER := 118;
SET @NPC_LONGSNOUT := 119;
SET @NPC_BROG_HAMFIST := 151;
SET @NPC_QUARTERMASTER_LEWIS := 491;
SET @NPC_MALORIAK := 41378;
SET @NPC_UNK_1000000 := 1000000;
SET @NPC_UNK_2000000 := 2000000;
SET @NPC_UNK_2000001 := 2000001;
SET @NPC_UNK_2000002 := 2000002;
SET @NPC_UNK_2000003 := 2000003;
SET @NPC_UNK_2000004 := 2000004;
SET @UNIT_FLAG_UNK_6 := 0x40;
SET @UNIT_FLAG_IMMUNE_TO_NPC := 0x200;
SET @UNIT_FLAG_NOT_SELECTABLE := 0x2000000;
-- creates one new creature template...
DELETE FROM `creature_template` WHERE `entry` = @NPC_UNK_1000000;
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `femaleName`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `exp_unk`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `type_flags2`, `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`, `HealthModifierExtra`, `ManaModifier`, `ManaModifierExtra`, `ArmorModifier`, `DamageModifier`, `ExperienceModifier`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(1000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, "my test name", "", "", "", 0, 1, 1, 0, 0, 0, 0, 1.0, 1.14286, 1.0, 0, 0, 0, 0, 1.0, 1.0, CLASS_WARRIOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "", 15995);
-- creates 5 templates with random values
DELETE FROM `creature_template` WHERE `entry` IN(@NPC_UNK_2000000, @NPC_UNK_2000003, @NPC_UNK_2000004, @NPC_UNK_2000001, @NPC_UNK_2000002);
INSERT INTO `creature_template` (`entry`, `difficulty_entry_1`, `difficulty_entry_2`, `difficulty_entry_3`, `KillCredit1`, `KillCredit2`, `modelid1`, `modelid2`, `modelid3`, `modelid4`, `name`, `femaleName`, `subname`, `IconName`, `gossip_menu_id`, `minlevel`, `maxlevel`, `exp`, `exp_unk`, `faction`, `npcflag`, `speed_walk`, `speed_run`, `scale`, `rank`, `dmgschool`, `BaseAttackTime`, `RangeAttackTime`, `BaseVariance`, `RangeVariance`, `unit_class`, `unit_flags`, `unit_flags2`, `dynamicflags`, `family`, `trainer_type`, `trainer_class`, `trainer_race`, `type`, `type_flags`, `type_flags2`, `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`, `HealthModifierExtra`, `ManaModifier`, `ManaModifierExtra`, `ArmorModifier`, `DamageModifier`, `ExperienceModifier`, `RacialLeader`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `movementId`, `RegenHealth`, `mechanic_immune_mask`, `flags_extra`, `ScriptName`, `VerifiedBuild`) VALUES
(2000000, 0, 0, 0, 8402, 0, 0, 0, 0, 0, "g7pcag", "", "", "", 0, 1, 1, 0, 0, 0, 0, 1.0, 1.14286, 1.0, 0, 0, 0, 0, 1.0, 1.0, CLASS_PALADIN, 25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "", 15995),
(2000003, 0, 0, 0, 2484, 0, 0, 0, 0, 0, "gb1s2f", "", "", "", 0, 1, 1, 0, 0, 0, 0, 1.0, 1.14286, 1.0, 0, 0, 0, 0, 1.0, 1.0, CLASS_MAGE, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "", 15995),
(2000004, 0, 0, 0, 4732, 0, 0, 0, 0, 0, "srer38fl4o601", "", "", "", 0, 1, 1, 0, 0, 0, 0, 1.0, 1.14286, 1.0, 0, 0, 0, 0, 1.0, 1.0, CLASS_PALADIN, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "", 15995),
(2000001, 0, 0, 0, 9947, 0, 0, 0, 0, 0, "b9cd", "", "", "", 0, 1, 1, 0, 0, 0, 0, 1.0, 1.14286, 1.0, 0, 0, 0, 0, 1.0, 1.0, CLASS_WARRIOR, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "", 15995),
(2000002, 0, 0, 0, 5021, 0, 0, 0, 0, 0, "1ksu", "", "", "", 0, 1, 1, 0, 0, 0, 0, 1.0, 1.14286, 1.0, 0, 0, 0, 0, 1.0, 1.0, CLASS_PALADIN, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", 0, 3, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "", 15995);
-- simple modify test
UPDATE `creature_template` SET `KillCredit1` = @CREDIT_CUSTOM_VARIABLE, `unit_class` = @CLASS_ROGUE WHERE `entry` = @NPC_BROG_HAMFIST;
UPDATE `creature_template` SET `name` = "blub" WHERE `entry` = @NPC_QUARTERMASTER_LEWIS;
-- deletes a creature template
DELETE FROM `creature_template` WHERE `entry` = @NPC_DISEASED_TIMBER_WOLF;
-- now we wanna delete multiple entrys, yay!
DELETE FROM `creature_template` WHERE `entry` IN(@NPC_HARVEST_REAPER, @NPC_BANDIT, @NPC_RIVERPAW_GNOLL, @NPC_PROWLER, @NPC_LONGSNOUT);
/* *
* some flag tests
* adds some strange flags to maloriak
* it only updates flags that have changed
*/
UPDATE `creature_template` SET `name` = "hey im here", `unit_flags` = (`unit_flags` &~ (@UNIT_FLAG_UNK_6)) | @UNIT_FLAG_IMMUNE_TO_NPC | @UNIT_FLAG_NOT_SELECTABLE WHERE `entry` = @NPC_MALORIAK;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment