Welcome to Ac-Web AC-Web

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask a Question

Ask Questions and Get Answers from Our Community

Ac-Web Official Repacks !

Here you will find all our official repacks

Contact Us

Contact a Staff member if needed

SQL Query set correct mana, armor damage

Tok124

Web/SQL Dev & 3D Artist
Modding
Webdev
joined: Oct 2, 2010
messages: 3,342
Reaction score: 226
Points: 63
Location: somewhere between <?php and ?>
Website trinitycore-sql-generator.com
Credits: 25
Hi ! A few days ago i released a query that allows you to set correct health for creatures. Now i have decided to also release a query for mana armor and damage. If you want to see how to set the correct health click This Link. I decided to make a completly new thread instead of updating the one for health since these queries is not related to health (except from the all in one query) and i wrote in title that its query for set correct health. And also because no one would actually see that i've updated the post. So i make a new thread so everyone can see it and hopefully someone wants to use these queries

Set Mana (This query requires unit_class 2 or 4 in creature_template)
Code:
SET
@mana = 100000, -- Choose how much mana you want here
@entry = 28948; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.ManaModifier = @mana / cc.basemana
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);

Set Armor
Code:
SET
@armor = 100000, -- Choose how much armor you want here
@entry = 28948; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.ArmorModifier = @armor / cc.basearmor
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);

Set Damage
Code:
SET
@damage = 100000, -- Choose how much damage you want here
@entry = 28948; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.DamageModifier = @damage / CASE
	WHEN ct.exp = 0 THEN cc.damage_base
	WHEN ct.exp = 1 THEN cc.damage_exp1
	WHEN ct.exp = 2 THEN cc.damage_exp2
END
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);

Set Attackpower (I dont think anyone ever needs this since you can set the damage for your creature instead of changing the attackpower but if anyone really do needs it here you go)
Code:
SET
@atkpwr = 2000, -- Choose how much Attackpower you want here
@entry = 28948; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.baseVariance = @atkpwr / cc.attackpower
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);

All in One Query (This query requires unit_class 2 or 4 in creature_template)
Attackpower query is not included in this one because its useless
Code:
SET
@health = 100000, -- Choose how much hp you want here
@mana = 100000, -- Choose how much mana you want here
@armor = 100000, -- Choose how much armor you want here
@damage = 100000, -- Choose how much damage you want here
@entry = 28948; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.HealthModifier = @health / CASE 
	WHEN ct.exp = 0 THEN cc.basehp0
	WHEN ct.exp = 1 THEN cc.basehp1
	WHEN ct.exp = 2 THEN cc.basehp2
END, 
ct.ManaModifier = @mana / cc.basemana,
ct.ArmorModifier = @armor / cc.basearmor,
ct.DamageModifier = @damage / CASE
	WHEN ct.exp = 0 THEN cc.damage_base
	WHEN ct.exp = 1 THEN cc.damage_exp1
	WHEN ct.exp = 2 THEN cc.damage_exp2
END
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);
 
Last edited:

CyberMist

Veteran
Emulation Team
Spu
joined: Dec 25, 2019
messages: 290
Reaction score: 39
Points: 28
Location: [email protected]
Credits: 343
corrected Mana modifier query, since it was giving an error, changed to this:

Code:
SET
@mana = 274000, -- Choose how much mana you want here
@entry = 1000003; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.ManaModifier = @mana / cc.basemana
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);

corrected Damage modifier query, this was giving error too, changed to this:

Code:
SET
@damage = 10000, -- Choose how much damage you want here
@entry = 1000003; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.DamageModifier = @damage / CASE
	WHEN ct.exp = 0 THEN cc.damage_base
	WHEN ct.exp = 1 THEN cc.damage_exp1
	WHEN ct.exp = 2 THEN cc.damage_exp2
END
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);

corrected Armor modifier query, giving error too, changed to this:

Code:
SET
@armor = 10000, -- Choose how much armor you want here
@entry = 1000003; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.ArmorModifier = @armor / cc.basearmor
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);
 
Last edited:

Tok124

Web/SQL Dev & 3D Artist
Modding
Webdev
joined: Oct 2, 2010
messages: 3,342
Reaction score: 226
Points: 63
Location: somewhere between <?php and ?>
Website trinitycore-sql-generator.com
Credits: 25
corrected Mana modifier query, since it was giving an error, changed to this:

Code:
SET
@mana = 274000, -- Choose how much mana you want here
@entry = 1000003; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.ManaModifier = @mana / cc.basemana
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);

corrected Damage modifier query, this was giving error too, changed to this:

Code:
SET
@damage = 10000, -- Choose how much damage you want here
@entry = 1000003; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.DamageModifier = @damage / CASE
	WHEN ct.exp = 0 THEN cc.damage_base
	WHEN ct.exp = 1 THEN cc.damage_exp1
	WHEN ct.exp = 2 THEN cc.damage_exp2
END
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);

corrected Armor modifier query, giving error too, changed to this:

Code:
SET
@armor = 10000, -- Choose how much armor you want here
@entry = 1000003; -- Set Creature Entry ID here

UPDATE creature_template ct
INNER JOIN creature_classlevelstats cc
ON ct.unit_class = cc.class
SET ct.ArmorModifier = @armor / cc.basearmor
WHERE ct.entry = @entry AND cc.level = ROUND((ct.minlevel + ct.maxlevel)/2, 1);
Oops... Damn my bad. I see i forgot to add SET. Thanks for updating it...
 
Back
Top