Formulas.h menu

Shout-Out

User Tag List

Thread: Formulas.h

Results 1 to 2 of 2
  1. #1
    sysken's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Formulas.h

    How do I change this so i can go hiher then lvl 80 and up to over 150. This is for Mangos server 3.0.9.

    /*
    * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
    *
    * This program is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation; either version 2 of the License, or
    * (at your option) any later version.
    *
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    * GNU General Public License for more details.
    *
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    */
    #ifndef MANGOS_FORMULAS_H
    #define MANGOS_FORMULAS_H
    #include"World.h"
    namespace MaNGOS
    {
    namespace Honor
    {
    inline uint32 hk_honor_at_level(uint32 level, uint32 count=1)
    {
    return (uint32)ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f )));
    }
    }
    namespace XP
    {
    enum XPColorChar { RED, ORANGE, YELLOW, GREEN, GRAY };
    inline uint32 GetGrayLevel(uint32 pl_level)
    {
    if( pl_level <= 5 )
    return 0;
    elseif( pl_level <= 39 )
    return pl_level - 5 - pl_level/10;
    elseif( pl_level <= 59 )
    return pl_level - 1 - pl_level/5;
    else
    return pl_level - 9;
    }
    inline XPColorChar GetColorCode(uint32 pl_level, uint32 mob_level)
    {
    if( mob_level >= pl_level + 5 )
    return RED;
    elseif( mob_level >= pl_level + 3 )
    return ORANGE;
    elseif( mob_level >= pl_level - 2 )
    return YELLOW;
    elseif( mob_level > GetGrayLevel(pl_level) )
    return GREEN;
    else
    return GRAY;
    }
    inline uint32 GetZeroDifference(uint32 pl_level)
    {
    if( pl_level < 8 ) return 5;
    if( pl_level < 10 ) return 6;
    if( pl_level < 12 ) return 7;
    if( pl_level < 16 ) return 8;
    if( pl_level < 20 ) return 9;
    if( pl_level < 30 ) return 11;
    if( pl_level < 40 ) return 12;
    if( pl_level < 45 ) return 13;
    if( pl_level < 50 ) return 14;
    if( pl_level < 55 ) return 15;
    if( pl_level < 60 ) return 16;
    return 17;
    }
    inline uint32 BaseGain(uint32 pl_level, uint32 mob_level, ContentLevels content)
    {
    uint32 nBaseExp;
    switch(content)
    {
    case CONTENT_1_60: nBaseExp = 45; break;
    case CONTENT_61_70: nBaseExp = 235; break;
    case CONTENT_71_80: nBaseExp = 580; break;
    default:
    sLog.outError("BaseGain: Unsupported content level %u",content);
    nBaseExp = 45; break;
    }
    if( mob_level >= pl_level )
    {
    uint32 nLevelDiff = mob_level - pl_level;
    if (nLevelDiff > 4)
    nLevelDiff = 4;
    return ((pl_level*5 + nBaseExp) * (20 + nLevelDiff)/10 + 1)/2;
    }
    else
    {
    uint32 gray_level = GetGrayLevel(pl_level);
    if( mob_level > gray_level )
    {
    uint32 ZD = GetZeroDifference(pl_level);
    return (pl_level*5 + nBaseExp) * (ZD + mob_level - pl_level)/ZD;
    }
    return 0;
    }
    }
    inline uint32 Gain(Player *pl, Unit *u)
    {
    if(u->GetTypeId()==TYPEID_UNIT && (
    ((Creature*)u)->isTotem() || ((Creature*)u)->isPet() ||
    (((Creature*)u)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_XP_AT_KILL) ))
    return 0;
    uint32 xp_gain= BaseGain(pl->getLevel(), u->getLevel(), GetContentLevelsForMapAndZone(pl->GetMapId(),pl->GetZoneId()));
    if( xp_gain == 0 )
    return 0;
    if(u->GetTypeId()==TYPEID_UNIT && ((Creature*)u)->isElite())
    xp_gain *= 2;
    return (uint32)(xp_gain*sWorld.getRate(RATE_XP_KILL));
    }
    inlinefloat xp_in_group_rate(uint32 count, bool isRaid)
    {
    if(isRaid)
    {
    // FIX ME: must apply decrease modifiers dependent from raid size
    return 1.0f;
    }
    else
    {
    switch(count)
    {
    case 0:
    case 1:
    case 2:
    return 1.0f;
    case 3:
    return 1.166f;
    case 4:
    return 1.3f;
    case 5:
    default:
    return 1.4f;
    }
    }
    }
    }
    }
    #endif

    Formulas.h
  2. #2
    XTZGZoReX's Avatar Active Member
    Reputation
    32
    Join Date
    Apr 2008
    Posts
    173
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Formulas.h isn't related to player levels... See the player_xp_perlevel (or so) table and the MAX_LEVEL define.

Similar Threads

  1. Enchanting Armor Formula Guide
    By encoming4u in forum World of Warcraft Guides
    Replies: 4
    Last Post: 09-12-2007, 09:16 AM
  2. Enchanting Weapon Formula Guide
    By encoming4u in forum World of Warcraft Guides
    Replies: 5
    Last Post: 09-11-2007, 09:45 PM
  3. LF Formula: Enchants list
    By bait in forum Community Chat
    Replies: 5
    Last Post: 09-03-2007, 08:38 PM
  4. Making Money with Fiery Formula
    By SwornEnemy in forum World of Warcraft Guides
    Replies: 11
    Last Post: 08-21-2007, 02:32 PM
  5. Major Spellpower Formula Farming
    By sol82 in forum World of Warcraft Guides
    Replies: 8
    Last Post: 05-19-2007, 04:21 PM
All times are GMT -5. The time now is 11:57 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search