• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

[VIP][MOD] Player Stat rates

slp13at420

Mad Scientist
This is an external mod dependent on my VIP Engine.

This requires you have installed my VIP Engine Found Here -> VIP Engine
[Minimum required ver. 2.10]

search your source for these files to edit:
src/server/game/entities/Unit/Statsystem.cpp
src/server/game/enteties/Player/Player.cpp

add if not already added at top with #includes:
Code:
[COLOR="#808080"]
#include "Grumboz_VIP_Core.h"
[/COLOR]



Armor Mod
src/server/game/entities/Unit/Statsystem.cpp

at top with #includes
Code:
[COLOR="#808080"]
#include "Grumboz_VIP_Core.h"
[/COLOR]

line 249 inside void Player::UpdateArmor()
Code:
[COLOR="#808080"]
	float VIP_OFFSET = sVIP->GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);
[/COLOR]

line 271 inside void Player::UpdateArmor()
replace SetArmor(uint32)value) with:

Code:
[COLOR="#808080"]
	uint32 THP = (uint32)value * MOD;
	int32 HPMOD = (int32)value + THP;

	SetArmor(HPMOD);
[/COLOR]



Health Mod
src/server/game/entities/Unit/Statsystem.cpp

at top with #includes
Code:
[COLOR="#808080"]
#include "Grumboz_VIP_Core.h"
#include "WorldSession.h"
[/COLOR]

line 302
replace void Player::UpdateMaxHealth()
Code:
[COLOR="#808080"]
void Player::UpdateMaxHealth()
{
	float VIP_OFFSET = sVIP->GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);

    UnitMods unitMod = UNIT_MOD_HEALTH;

    float value = GetModifierValue(unitMod, BASE_VALUE) + GetCreateHealth();
    value *= GetModifierValue(unitMod, BASE_PCT);
    value += GetModifierValue(unitMod, TOTAL_VALUE) + GetHealthBonusFromStamina();
    value *= GetModifierValue(unitMod, TOTAL_PCT);

    float THP = (uint32)value * MOD;
    float HPMOD = (uint32)value + THP;

    SetMaxHealth(uint32(HPMOD));
}
[/COLOR]



Item Stat Mod
src/server/game/enteties/Player/Player.cpp

inside void Player::_ApplyItemBonuses(ItemTemplate const* proto, uint8 slot, bool apply, bool only_level_scale /*= false*/)

line 7820
Code:
[COLOR="#808080"]
	float VIP_OFFSET = sVIP->GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);
[/COLOR]

inside switch (statType)

use + (val * MOD) for increasing stats like
Code:
[COLOR="#808080"]
            case ITEM_MOD_MANA:
                HandleStatModifier(UNIT_MOD_MANA, BASE_VALUE, float(val + (val * MOD)), apply);
                break;
[/COLOR]

use - (val * MOD) for x taken ratings like
Code:
[COLOR="#808080"]
           case ITEM_MOD_HIT_TAKEN_RATING:
                ApplyRatingMod(CR_HIT_TAKEN_MELEE, int32(val - (val * MOD)), apply);
                ApplyRatingMod(CR_HIT_TAKEN_RANGED, int32(val - (val * MOD)), apply);
                ApplyRatingMod(CR_HIT_TAKEN_SPELL, int32(val - (val * MOD)), apply);
                break;
[/COLOR]



Talent Mod
src/server/game/entities/Player.cpp

inside void Player::InitTalentForLevel()

line 3144
Code:
[COLOR="#808080"]
	uint32 acct_id = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acct_id);
	uint8 VIP_TP_BONUS = sVIP->GetTALENTBONUS();
	uint8 TPMOD = (Pvip * VIP_TP_BONUS);
[/COLOR]

line 3157 replace if (m_usedTalentCount > (talentPointsForLevel)
Code:
[COLOR="#808080"]
        if (m_usedTalentCount > (talentPointsForLevel + TPMOD))
[/COLOR]

line 3171 replace SetFreeTalentPoints(talentPointsForLevel - m_usedTalentCount);
Code:
[COLOR="#808080"]
			SetFreeTalentPoints((talentPointsForLevel + TPMOD) - m_usedTalentCount);
[/COLOR]

inside bool Player::resetTalents(bool no_cost)
line 4393
Code:
[COLOR="#808080"]
	uint32 acct_id = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acct_id);
	uint8 VIP_TP_BONUS = sVIP->GetTALENTBONUS();
	uint8 TPMOD = (Pvip * VIP_TP_BONUS);
[/COLOR]

inside if (m_usedTalentCount == 0)
line 4410
Code:
[COLOR="#808080"]
		SetFreeTalentPoints(talentPointsForLevel + TPMOD);
[/COLOR]

line 4472 replace SetFreeTalentPoints(talentPointsForLevel);
Code:
[COLOR="#808080"]
	SetFreeTalentPoints(talentPointsForLevel + TPMOD);
[/COLOR]



Weapon Dmg Mod
/src/server/game/enteties/Player/
player.cpp

inside _ApplyWeaponDamage()

line 8117
Code:
[COLOR="#808080"]
	float VIP_OFFSET = sVIP->GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);
[/COLOR]
line 8133 replace minDamage and maxDamage
Code:
[COLOR="#808080"]
	float minDamage = proto->Damage[0].DamageMin + (proto->Damage[0].DamageMin / MOD);
	float maxDamage = proto->Damage[0].DamageMax + (proto->Damage[0].DamageMax / MOD);
[/COLOR]

-----------------------------------------------------

/src/server/game/enteties/Unit/StatSystem.cpp

void Player::CalculateMinMaxDamage line 534
Code:
[COLOR="#808080"]
	float VIP_OFFSET = sVIP->GetVIPOFFSET();
	uint32 acctId = GetSession()->GetAccountId();
	uint8 Pvip = sVIP->GetPlayerVIP(acctId);
	float MOD = (Pvip * VIP_OFFSET);
[/COLOR]

line 556
Code:
[COLOR="#808080"]
	float weaponMinDamage = GetWeaponDamageRange(attType, MINDAMAGE) + (GetWeaponDamageRange(attType, MINDAMAGE) / MOD);
	float weaponMaxDamage = GetWeaponDamageRange(attType, MAXDAMAGE) + (GetWeaponDamageRange(attType, MAXDAMAGE) / MOD);
[/COLOR]

 
Last edited:

slp13at420

Mad Scientist
alas the only code of your VIP System I could scavenge, I did back it up here:
https://www.dropbox.com/s/x4qx0gh2pqmhn5q/Loot rates.txt?dl=0

I didn't start this until after you had deleted all your pastebins.
But yea I think this would be the most common logical way to modify these stats other than maybe send the val to your VIP engine to be adjusted and return adjusted val for each frigin stat +/- lol

I really wanted to go thru yours and review how your system handled things but I never found anything else but that lol n I don't even remember where I found it .

I would love to collaborate with you on expanding my system to influence a players roll and drop rate of items. I think im gonna need to mod a few default methods to pass the % modifier*vip around .
I just need to figure out the method flow from kill, to calc each item drop by rate, to calc the players roll...
 
Top