关灯
开启左侧

宠物增加攻击,防御,生命值倍率设置(参考)[老版Mangos]

  [复制链接]
admin实名认证 发表于 2016-5-3 23:04:02 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
 
攻击,防御,生命值倍率的设定

请在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,
标签:宠物
 
VIP介绍
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 最佳新人

    注册账号后积极发帖的会员
  • 活跃会员

    经常参与各类话题的讨论,发帖内容较有主见
  • 热心会员

    经常帮助其他会员答疑
  • 推广达人

    积极宣传本站,为本站带来更多注册会员
  • 宣传达人

    积极宣传本站,为本站带来更多的用户访问量
  • 灌水之王

    经常在论坛发帖,且发帖量较大
  • 突出贡献

    长期对论坛的繁荣而不断努力,或多次提出建设性意见
  • 优秀版主

    活跃且尽责职守的版主
  • 荣誉管理

    曾经为论坛做出突出贡献目前已离职的版主
  • 论坛元老

    为论坛做出突出贡献的会员

0关注

5粉丝

3421帖子

排行榜
作者专栏

QQ交流群&&微信订阅号

QQ交流群

微信订阅号

吾爱尚玩资源基地永久域名:

Www.523Play.Com

在线管理员QQ:1589479632

邮箱:Email@523play.com

QQ交流群:558936238

Copyright   ©2015-2116  吾爱尚玩资源基地|523play.comPowered by©523Pplay.Com技术支持:吾爱尚玩资源基地