- Timestamp:
- 11/19/08 13:35:09 (17 years ago)
- Location:
- trunk/src/game
- Files:
-
- 7 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Formulas.h
r44 r96 26 26 namespace Trinity 27 27 { 28 namespace Honor 29 { 30 inline uint32 hk_honor_at_level(uint32 level, uint32 count=1) 31 { 32 return ceil(count*(-0.53177f + 0.59357f * exp((level +23.54042f) / 26.07859f ))); 33 } 34 } 28 35 namespace XP 29 36 { -
trunk/src/game/GossipDef.cpp
r44 r96 25 25 #include "WorldPacket.h" 26 26 #include "WorldSession.h" 27 #include "Formulas.h" 27 28 28 29 GossipMenu::GossipMenu() … … 467 468 } 468 469 469 data << uint32(0); // Honor points reward, not implemented470 data << uint32( pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0)470 // rewarded honor points. Multiply with 10 to satisfy client data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0) 471 data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); 471 472 data << uint32(pQuest->GetRewSpellCast()); // casted spell 472 473 data << uint32(pQuest->GetCharTitleId()); // CharTitleId, new 2.4.0, player gets this title (id from CharTitles) … … 542 543 data << uint32(pQuest->GetRewSpellCast()); // casted spell 543 544 544 data << uint32(0); // Honor points reward, not implemented 545 // rewarded honor points 546 data << uint32(Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); 545 547 data << uint32(pQuest->GetSrcItemId()); 546 548 data << uint32(pQuest->GetFlags() & 0xFFFF); … … 676 678 677 679 data << uint32(pQuest->GetRewOrReqMoney()); 678 data << uint32(0x00); // new 2.3.0. Honor points 680 // rewarded honor points. Multiply with 10 to satisfy client 681 data << uint32(10*Trinity::Honor::hk_honor_at_level(pSession->GetPlayer()->getLevel(), pQuest->GetRewHonorableKills())); 679 682 data << uint32(0x08); // unused by client? 680 683 data << uint32(pQuest->GetRewSpell()); // reward spell, this spell will display (icon) (casted if RewSpellCast==0) 681 684 data << uint32(pQuest->GetRewSpellCast()); // casted spell 682 data << uint32(0 ); // Honor points reward, not implemented685 data << uint32(0x00); // unk, NOT honor 683 686 pSession->SendPacket( &data ); 684 687 sLog.outDebug( "WORLD: Sent SMSG_QUESTGIVER_OFFER_REWARD NPCGuid=%u, questid=%u",GUID_LOPART(npcGUID),pQuest->GetQuestId() ); -
trunk/src/game/ObjectMgr.cpp
r95 r96 2809 2809 // 89 90 91 92 93 94 95 96 97 98 2810 2810 "RewRepFaction1, RewRepFaction2, RewRepFaction3, RewRepFaction4, RewRepFaction5, RewRepValue1, RewRepValue2, RewRepValue3, RewRepValue4, RewRepValue5," 2811 // 99 100 101 102 103 104 105 106 107 108 2812 "RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt," 2813 // 109 110 111 112 113 114 115 116 117 118 2814 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4,IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," 2815 // 119 120 2811 // 99 100 101 102 103 104 105 106 107 108 109 2812 "RewHonorableKills, RewOrReqMoney, RewMoneyMaxLevel, RewSpell, RewSpellCast, RewMailTemplateId, RewMailDelaySecs, PointMapId, PointX, PointY, PointOpt," 2813 // 110 111 112 113 114 115 116 117 118 119 "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4,IncompleteEmote, CompleteEmote, OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4," 2814 // 120 121 2816 2815 "StartScript, CompleteScript" 2817 2816 " FROM quest_template"); -
trunk/src/game/Player.cpp
r95 r96 12377 12377 ModifyMoney( pQuest->GetRewOrReqMoney() ); 12378 12378 12379 // honor reward 12380 if(pQuest->GetRewHonorableKills()) 12381 RewardHonor(NULL, 0, Trinity::Honor::hk_honor_at_level(getLevel(), pQuest->GetRewHonorableKills())); 12382 12379 12383 // title reward 12380 12384 if(pQuest->GetCharTitleId()) -
trunk/src/game/QuestDef.cpp
r44 r96 104 104 RewRepValue[i] = questRecord[94+i].GetInt32(); 105 105 106 RewOrReqMoney = questRecord[99].GetInt32(); 107 RewMoneyMaxLevel = questRecord[100].GetUInt32(); 108 RewSpell = questRecord[101].GetUInt32(); 109 RewSpellCast = questRecord[102].GetUInt32(); 110 RewMailTemplateId = questRecord[103].GetUInt32(); 111 RewMailDelaySecs = questRecord[104].GetUInt32(); 112 PointMapId = questRecord[105].GetUInt32(); 113 PointX = questRecord[106].GetFloat(); 114 PointY = questRecord[107].GetFloat(); 115 PointOpt = questRecord[108].GetUInt32(); 106 RewHonorableKills = questRecord[99].GetUInt32(); 107 RewOrReqMoney = questRecord[100].GetInt32(); 108 RewMoneyMaxLevel = questRecord[101].GetUInt32(); 109 RewSpell = questRecord[102].GetUInt32(); 110 RewSpellCast = questRecord[103].GetUInt32(); 111 RewMailTemplateId = questRecord[104].GetUInt32(); 112 RewMailDelaySecs = questRecord[105].GetUInt32(); 113 PointMapId = questRecord[106].GetUInt32(); 114 PointX = questRecord[107].GetFloat(); 115 PointY = questRecord[108].GetFloat(); 116 PointOpt = questRecord[109].GetUInt32(); 116 117 117 118 for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) 118 DetailsEmote[i] = questRecord[1 09+i].GetUInt32();119 120 IncompleteEmote = questRecord[11 3].GetUInt32();121 CompleteEmote = questRecord[11 4].GetUInt32();119 DetailsEmote[i] = questRecord[110+i].GetUInt32(); 120 121 IncompleteEmote = questRecord[114].GetUInt32(); 122 CompleteEmote = questRecord[115].GetUInt32(); 122 123 123 124 for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) 124 OfferRewardEmote[i] = questRecord[11 5+i].GetInt32();125 126 QuestStartScript = questRecord[1 19].GetUInt32();127 QuestCompleteScript = questRecord[12 0].GetUInt32();125 OfferRewardEmote[i] = questRecord[116+i].GetInt32(); 126 127 QuestStartScript = questRecord[120].GetUInt32(); 128 QuestCompleteScript = questRecord[121].GetUInt32(); 128 129 129 130 QuestFlags |= SpecialFlags << 16; -
trunk/src/game/QuestDef.h
r44 r96 201 201 std::string GetEndText() const { return EndText; } 202 202 int32 GetRewOrReqMoney() const; 203 uint32 GetRewHonorableKills() const { return RewHonorableKills; } 203 204 uint32 GetRewMoneyMaxLevel() const { return RewMoneyMaxLevel; } 204 205 // use in XP calculation at client … … 290 291 std::string RequestItemsText; 291 292 std::string EndText; 293 uint32 RewHonorableKills; 292 294 int32 RewOrReqMoney; 293 295 uint32 RewMoneyMaxLevel; -
trunk/src/game/SpellAuras.cpp
r74 r96 1953 1953 case 43873: // Headless Horseman Laugh 1954 1954 if(caster->GetTypeId() == TYPEID_PLAYER) 1955 {1956 1955 ((Player*)caster)->SendPlaySound(11965, false); 1957 }1958 1956 return; 1959 1957 case 46354: // Blood Elf Illusion … … 2507 2505 // remove other shapeshift before applying a new one 2508 2506 if(m_target->m_ShapeShiftFormSpellId) 2509 {2510 2507 m_target->RemoveAurasDueToSpell(m_target->m_ShapeShiftFormSpellId,this); 2511 }2512 2508 2513 2509 m_target->SetByteValue(UNIT_FIELD_BYTES_2, 3, form); 2514 2510 2515 2511 if(modelid > 0) 2516 {2517 2512 m_target->SetDisplayId(modelid); 2518 }2519 2513 2520 2514 if(PowerType != POWER_MANA) … … 2546 2540 m_target->SetPower(POWER_ENERGY,0); 2547 2541 if(urand(1,100) <= FurorChance) 2548 {2549 2542 m_target->CastSpell(m_target,17099,true,NULL,this); 2550 }2551 2543 } 2552 2544 else … … 2554 2546 m_target->SetPower(POWER_RAGE,0); 2555 2547 if(urand(1,100) <= FurorChance) 2556 {2557 2548 m_target->CastSpell(m_target,17057,true,NULL,this); 2558 }2559 2549 } 2560 2550 break; … … 2948 2938 2949 2939 if(m_target->GetTypeId() == TYPEID_PLAYER) 2950 {2951 2940 ((Player*)m_target)->setFactionForRace(m_target->getRace()); 2952 } 2941 2953 2942 else if(m_target->GetTypeId() == TYPEID_UNIT) 2954 2943 { … … 3057 3046 3058 3047 if(m_target->GetTypeId() == TYPEID_PLAYER) 3059 {3060 3048 ((Player*)m_target)->setFactionForRace(m_target->getRace()); 3061 }3062 3049 else 3063 3050 { … … 3643 3630 3644 3631 if(apply) 3645 {3646 3632 m_target->TauntApply(caster); 3647 }3648 3633 else 3649 3634 { … … 4317 4302 //pets only have base armor 4318 4303 if(((Creature*)m_target)->isPet() && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)) 4319 {4320 4304 m_target->HandleStatModifier(UNIT_MOD_ARMOR, BASE_PCT, float(m_modifier.m_amount), apply); 4321 }4322 4305 } 4323 4306 else … … 4326 4309 { 4327 4310 if(m_modifier.m_miscvalue & int32(1<<x)) 4328 {4329 4311 m_target->HandleStatModifier(UnitMods(UNIT_MOD_RESISTANCE_START + x), BASE_PCT, float(m_modifier.m_amount), apply); 4330 }4331 4312 } 4332 4313 } … … 4406 4387 { 4407 4388 if(m_modifier.m_miscvalue == i || m_modifier.m_miscvalue == -1) 4408 {4409 4389 m_target->HandleStatModifier(UnitMods(UNIT_MOD_STAT_START + i), BASE_PCT, float(m_modifier.m_amount), apply); 4410 }4411 4390 } 4412 4391 } … … 5323 5302 CreatureInfo const * ci = objmgr.GetCreatureTemplate(m_target->GetEntry()); 5324 5303 if(ci && ci->type == CREATURE_TYPE_BEAST) 5325 {5326 5304 m_target->ApplyModUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_SPECIALINFO, apply); 5327 }5328 5305 } 5329 5306