Welcome to AC Web.
Results 1 to 3 of 3
  1. #1
    Web/SQL Dev & 3D Artist

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    3,255

    SQL Query set correct mana, armor damage


    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    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
    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
    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
    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);

  2. #2
    thanks for share

  3. #3
    Web/SQL Dev & 3D Artist

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    3,255

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by Blake Barraclough View Post
    thanks for share
    No problem

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •