已经格式化,给有需要的兄弟。
- // Rage from Damage made (only from direct weapon damage)
- if (cleanDamage && damagetype == DIRECT_DAMAGE && this != victim && getPowerType() == POWER_RAGE) {
- if (cleanDamage->hitOutCome == MELEE_HIT_NORMAL || cleanDamage->hitOutCome == MELEE_HIT_CRIT) {
- if (Player* player = ToPlayer()) {
- float rage = 3.5f;
- uint8 wSlot = EQUIPMENT_SLOT_MAINHAND;
- float mod = 2.f;
-
- if (cleanDamage->attackType == OFF_ATTACK) {
- wSlot = EQUIPMENT_SLOT_OFFHAND;
- mod = 4.f;
- }
-
- if (Item* weapon = player->GetItemByPos(INVENTORY_SLOT_BAG_0, wSlot)) {
- if (ItemTemplate const* temp = weapon->GetTemplate()) {
- rage = rage * float(temp->GetDelay()) / 1000.f / mod;
- }
- }
-
- if (cleanDamage->hitOutCome == MELEE_HIT_CRIT) {
- AddPct(rage, 50.f);
- }
-
- RewardRage(rage, true);
- }
- }
- }
复制代码
|