Главная | Форум | Статьи | Фaйлы| Картинки WoW | Профиль | Регистрация | Вход

[ Новые сообщения · Правила форума · Поиск · RSS ]

WoW-Info — информационный World of Warcraft портал

[Patch] Combat Log Experience - Форум

  • Сторінка 1 з 1
  • 1
[Patch] Combat Log Experience
DjumHoRDeДата: Четвер, 16.12.2010, 14:09 | Сообщение # 1



DjumHoRDe
Скаут
Группа: Пользователи
Сообщений: 38

Замечания:

Оффлайн
Исправления опыта в журнале боя .

Quote
Index: Chat/ChatMgr.cs
===================================================================
--- Chat/ChatMgr.cs (revision 849)
+++ Chat/ChatMgr.cs (working copy)
@@ -589,7 +589,21 @@
}
}

+
/// <summary>
+ /// Sends the amount of experience gained to the characters combat log.
+ /// </summary>
+ /// <param name="target">the character to receieve the combat log message</param>
+ /// <param name="message">the message to display in the characters combat log</param>
+ public static void SendCombatLogExperienceMessage(IPacketReceiver target, string message)
+ {
+ using (var packet = CreateCharChatMessage(ChatMsgType.CombatXPGain, ChatLanguage.Universal, EntityId.Zero, EntityId.Zero, null, message, ChatTag.None))
+ {
+ target.Send(packet);
+ }
+ }
+
+ /// <summary>
/// Sends a whisper from one player to another.
/// </summary>
/// <param name="sender">the sender of the whisper</param>
Index: Entities/Character.cs
===================================================================
--- Entities/Character.cs (revision 849)
+++ Entities/Character.cs (working copy)
@@ -556,6 +556,35 @@
{
this.SayYellEmote(ChatMsgType.Emote, SpokenLanguage, msg);
}
+
+ /// <summary>
+ /// Sends the amount of experience gained to the characters combat log.
+ /// </summary>
+ /// <param name="enemy">The enemy that the character just killed.</param>
+ /// <param name="experience">The amount of experience gained from it.</param>
+ public void SendCombatLogExperience(Unit enemy, int experience)
+ {
+ if (enemy == null)
+ {
+ return;
+ }
+
+ // Generate the message to send
+ string message = string.Format("{0} dies, you gain {1} experience.", enemy.Name, experience);
+ string bonusMessage;
+
+ // Check for any rest Xp
+ var bonus = Math.Min(RestXp, experience);
+
+ if (bonus > 0)
+ {
+ bonusMessage = string.Format(" (+{0} exp Rested bonus)", bonus);
+ message = string.Concat(message, bonusMessage);
+ }
+
+ // Send the message
+ ChatMgr.SendCombatLogExperienceMessage(this, message);
+ }
#endregion

public void Send(RealmPacketOut packet)
Index: Entities/NPC.cs
===================================================================
--- Entities/NPC.cs (revision 849)
+++ Entities/NPC.cs (working copy)
@@ -862,8 +862,9 @@
// TODO: Consider reductions if someone else killed the mob
var chr = (Character)looter;
var baseXp = m_region.XpCalculator(looter.Level, this);
+ chr.SendCombatLogExperience(this, baseXp);
XpGenerator.XpDistributer(chr, baseXp);
- chr.QuestLog.OnNPCKilled(this);
+ chr.QuestLog.OnNPCKilled(this);
}

if (m_currentTamer != null)



 
  • Сторінка 1 з 1
  • 1
Пошук:

Новые сообщения в темах
Сдам в аренду сервер и хостинг · (Хост Предложения)
Автор: redlaine
Последнее сообщение в 23:53
хаха :D · (Приколы)
Автор: [N1ke]Medved
Последнее сообщение в 18:40
Autobattle - новый боевой бот ... · (Боты для WoW)
Автор: terrikon
Последнее сообщение в 18:39
PvE руководство для Чернокнижн... · (Чернокнижник)
Автор: Darkensand
Последнее сообщение в 18:38
Пустой свиток (Часть 11) · (Истории WoW)
Автор: R_a_Z_o_R
Последнее сообщение в 18:37
Друиды в Катаклизме: Официальн... · (Друид)
Автор: Darkensand
Последнее сообщение в 18:37
[Баг 3.3.5] Фарм ледяных бадже... · (Читы для WoW)
Автор: Darkensand
Последнее сообщение в 18:35
FarmBot (Бот для фарма руды и ... · (Боты для WoW)
Автор: homma
Последнее сообщение в 18:34
Почему мы сражаемся: ролевая и... · (Воин)
Автор: Darkensand
Последнее сообщение в 18:34
Книги по Wold of Warcraft · (Истории WoW)
Автор: R_a_Z_o_R
Последнее сообщение в 18:33
Маг огня в Cataclysm · (Маг)
Автор: Darkensand
Последнее сообщение в 18:33
Как начать играть в World of W... · (Полезно знать)
Автор: Belkmondesh
Последнее сообщение в 18:32
Характеризация профессий · (Профессии)
Автор: Darkensand
Последнее сообщение в 18:31
Что значит для арканов бета те... · (Маг)
Автор: Darkensand
Последнее сообщение в 18:31

Контакты Контакты Copyright WoW-Info — World of Warcraft портал © 2025 | Условия и правила использования ресурса | Реклама / Услуги
WoW-Info портал.World of Warcraft портал — готовые сервера, сайты, картинки, аддоны, патчи, читы, баги, mangos, ArcEmu, TrinityCore, Warcraft 3, новости, Cataclysm...
Яндекс.Метрика Хостинг від uCoz