[老版Mangos]宠物增加攻击,防御,生命值倍率设置(参考)
2013-07-17 11:57:01 作者:www.10cpop.com 来源: 浏览次数:0
 增加了攻击,防御,生命值倍率的设定

请在conf文件里加上设置参数,倍率自己设置。
Rate.pet.Att = 1
Rate.pet.Armor = 1
Rate.pet.Hp = 1
Rate.pet.Tp = 1

虽然下面的补丁里有加训练点数倍率,但不是很完美,
比如设置成2倍,会无限制的翻倍,恩

这个是比较老的mangos的魔兽世界的单机代码了!目前可能不能直接用到M端WOW单机或则T端上!!

不过,希望对喜欢WOW单机的朋友作为一些小小的帮助!

这个是对魔兽宠物的攻击,防御做倍率的设置。。如果你喜欢做变态的单机魔兽,。可以试试~~~


Index: src/game/Pet.cpp
===================================================================
--- src/game/Pet.cpp (revision 5921)
+++ src/game/Pet.cpp (working copy)
@@ -30,6 +30,7 @@
#include "CreatureAI.h"
#include "Unit.h"

+
char const* petTypeSuffix[MAX_PET_TYPE] =
{
"'s Minion", // SUMMON_PET
@@ -745,7 +746,7 @@

void Pet::SetTP(int32 TP)
{
- m_TrainingPoints = TP;
+ m_TrainingPoints = TP*sWorld.getRate(RATE_PET_TP);
SetUInt32Value(UNIT_TRAINING_POINTS, (uint32)GetDispTP());
}

@@ -905,7 +906,7 @@

SetMeleeDamageSchool(SpellSchools(cinfo->dmgschool));

- SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(petlevel*50));
+ SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(petlevel*50*sWorld.getRate(RATE_PET_ARMOR)));

SetAttackTime(BASE_ATTACK, BASE_ATTACK_TIME);

@@ -962,15 +963,15 @@
}
}

- SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) );
- SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)) );
+ SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel - (petlevel / 4))*sWorld.getRate(RATE_PET_ATT)) );
+ SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel + (petlevel / 4))*sWorld.getRate(RATE_PET_ATT)) );

//SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower));

PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
if(pInfo) // exist in DB
{
- SetCreateHealth(pInfo->health);
+ SetCreateHealth((pInfo->health)*sWorld.getRate(RATE_PET_HP));
SetCreateMana(pInfo->mana);

for(int stat = 0; stat < MAX_STATS; ++stat)
@@ -983,7 +984,7 @@
sLog.outErrorDb("Summoned pet (Entry: %u) not have pet stats data in DB",cinfo->Entry);

// remove elite bonuses included in DB values
- SetCreateHealth(uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel) );
+ SetCreateHealth(uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel*sWorld.getRate(RATE_PET_HP)) );
SetCreateMana( uint32(((float(cinfo->maxmana) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel) );

SetCreateStat(STAT_STRENGTH,22);
@@ -1000,17 +1001,17 @@

//these formula may not be correct; however, it is designed to be close to what it should be
//this makes dps 0.5 of pets level
- SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float(petlevel - (petlevel / 4)) );
+ SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, float((petlevel - (petlevel / 4))*sWorld.getRate(RATE_PET_ATT)) );
//damage range is then petlevel / 2
- SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float(petlevel + (petlevel / 4)) );
+ SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, float((petlevel + (petlevel / 4))*sWorld.getRate(RATE_PET_ATT)) );
//damage is increased afterwards as strength and pet scaling modify attack power

//stored standart pet stats are entry 1 in pet_levelinfo
PetLevelInfo const* pInfo = objmgr.GetPetLevelInfo(creature_ID, petlevel);
if(pInfo) // exist in DB
{
- SetCreateHealth(pInfo->health);
- SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float(pInfo->armor));
+ SetCreateHealth((pInfo->health)*sWorld.getRate(RATE_PET_HP));
+ SetModifierValue(UNIT_MOD_ARMOR, BASE_VALUE, float((pInfo->armor)*sWorld.getRate(RATE_PET_ARMOR)));
//SetModifierValue(UNIT_MOD_ATTACK_POWER, BASE_VALUE, float(cinfo->attackpower));

for( int i = STAT_STRENGTH; i < MAX_STATS; i++)
@@ -1023,7 +1024,7 @@
sLog.outErrorDb("Hunter pet levelstats missing in DB");

// remove elite bonuses included in DB values
- SetCreateHealth( uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel) );
+ SetCreateHealth( uint32(((float(cinfo->maxhealth) / cinfo->maxlevel) / (1 + 2 * cinfo->rank)) * petlevel*sWorld.getRate(RATE_PET_HP)) );

SetCreateStat(STAT_STRENGTH,22);
SetCreateStat(STAT_AGILITY,22);
Index: src/game/World.cpp
===================================================================
--- src/game/World.cpp (revision 5921)
+++ src/game/World.cpp (working copy)
@@ -340,6 +340,10 @@
sLog.outError("Rate.Rage.Loss (%f) mustbe > 0. Using 1 instead.",rate_values[RATE_POWER_RAGE_LOSS]);
rate_values[RATE_POWER_RAGE_LOSS] = 1;
}
+ rate_values[RATE_PET_ATT] = sConfig.GetFloatDefault("Rate.Pet.Att", 1);
+ rate_values[RATE_PET_ARMOR] = sConfig.GetFloatDefault("Rate.Pet.Armor", 1);
+ rate_values[RATE_PET_HP] = sConfig.GetFloatDefault("Rate.Pet.Hp", 1);
+ rate_values[RATE_PET_TP] = sConfig.GetFloatDefault("Rate.Pet.Tp", 1);
rate_values[RATE_POWER_FOCUS] = sConfig.GetFloatDefault("Rate.Focus", 1);
rate_values[RATE_LOYALTY] = sConfig.GetFloatDefault("Rate.Loyalty", 1);
rate_values[RATE_DROP_ITEMS] = sConfig.GetFloatDefault("Rate.Drop.Items", 1);
Index: src/game/World.h
===================================================================
--- src/game/World.h (revision 5921)
+++ src/game/World.h (working copy)
@@ -139,6 +139,10 @@
/// Server rates
enum Rates
{
+ RATE_PET_ATT,
+ RATE_PET_ARMOR,
+ RATE_PET_HP,
+ RATE_PET_TP,
RATE_HEALTH=0,
RATE_POWER_MANA,
RATE_POWER_RAGE_INCOME,




相关报道:

[关闭] [返回顶部]


  返回首页 | 最新资讯 | 游戏下载 | 魔兽图片 | 魔兽单机 | 视频攻略 | 最新更新

 
Copyright © 2014 - 2016 10CPOP Corporation, All Rights Reserved


十城魔兽世界私服