*Implement aura type SPELL_AURA_MOD_XP_QUEST_PCT (291) and fix SPELL_AURA_MOD_XP_PCT(200) handler.

*Correct structure stored in world.sql for npc_spellclick_spells and fix world_script_text application.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-17 14:55:50 +02:00
parent 798ff48c59
commit 445b8236a1
5 changed files with 23 additions and 10 deletions
+1 -1
View File
@@ -2074,5 +2074,5 @@ INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `lang0`, `prob0`, `em0_0`, `
-- Dual Spec `npc_option` change
UPDATE `npc_option` SET `id`=52,`action`=19 WHERE `id`=51 AND `action`=18 AND `option_text`='UNIT_NPC_FLAG_OUTDOORPVP';
DELETE FROM `npc_option` WHERE `id`=51 AND `action`=16 AND `option_text`='Purchase a Dual Talent Specialization.';
DELETE FROM `npc_option` WHERE `id`=51;
INSERT INTO `npc_option` (`id`, `gossip_id`, `npcflag`, `icon`, `action`, `box_money`, `coded`, `option_text`, `box_text`) values('51','0','16','0','18','10000000','0','Purchase a Dual Talent Specialization.','Are you sure you wish to purchase a Dual Talent Specialization?');
+3 -1
View File
@@ -1890,7 +1890,9 @@ SET character_set_client = utf8;
CREATE TABLE `npc_spellclick_spells` (
`npc_entry` int(10) unsigned NOT NULL COMMENT 'reference to creature_template',
`spell_id` int(10) unsigned NOT NULL COMMENT 'spell which should be casted ',
`quest_id` int(10) unsigned NOT NULL COMMENT 'reference to quest_template',
`quest_start` mediumint(8) unsigned NOT NULL COMMENT 'reference to quest_template',
`quest_start_active` tinyint(1) unsigned NOT NULL default '0',
`quest_end` mediumint(8) unsigned NOT NULL default '0',
`cast_flags` tinyint(3) unsigned NOT NULL COMMENT 'first bit defines caster: 1=player, 0=creature; second bit defines target, same mapping as caster bit',
`aura_required` int(11) unsigned NOT NULL default '0' COMMENT 'player without aura cant click',
`aura_forbidden` int(11) unsigned NOT NULL default '0' COMMENT 'player with aura cant click',
+16 -5
View File
@@ -2430,11 +2430,6 @@ void Player::GiveXP(uint32 xp, Unit* victim)
if(level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
return;
// handle SPELL_AURA_MOD_XP_PCT auras
Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
xp = uint32(xp*(1.0f + (*i)->GetAmount() / 100.0f));
// XP resting bonus for kill
uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0;
@@ -13174,6 +13169,11 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
// Not give XP in case already completed once repeatable quest
uint32 XP = q_status.m_rewarded ? 0 : uint32(pQuest->XPValue( this )*sWorld.getRate(RATE_XP_QUEST));
// handle SPELL_AURA_MOD_XP_QUEST_PCT auras
Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_QUEST_PCT);
for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
XP = uint32(XP*(100.0f + (*i)->GetAmount() / 100.0f));
if (getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
GiveXP( XP , NULL );
else
@@ -20036,6 +20036,11 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
{
uint32 itr_xp = (member_with_max_level == not_gray_member_with_max_level) ? uint32(xp*rate) : uint32((xp*rate/2)+1);
// handle SPELL_AURA_MOD_XP_PCT auras
Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
itr_xp = uint32(itr_xp*(100.0f + (*i)->GetAmount() / 100.0f));
pGroupGuy->GiveXP(itr_xp, pVictim);
if(Pet* pet = pGroupGuy->GetPet())
pet->GivePetXP(itr_xp/2);
@@ -20064,6 +20069,12 @@ bool Player::RewardPlayerAndGroupAtKill(Unit* pVictim)
if(!PvP)
{
RewardReputation(pVictim,1);
// handle SPELL_AURA_MOD_XP_PCT auras
Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
xp = uint32(xp*(100.0f + (*i)->GetAmount() / 100.0f));
GiveXP(xp, pVictim);
if(Pet* pet = GetPet())
+1 -1
View File
@@ -336,7 +336,7 @@ enum AuraType
SPELL_AURA_288,
SPELL_AURA_289,
SPELL_AURA_MOD_CRIT_CHANCE,
SPELL_AURA_291,
SPELL_AURA_MOD_XP_QUEST_PCT,
SPELL_AURA_292,
SPELL_AURA_293,
SPELL_AURA_294,
+2 -2
View File
@@ -253,7 +253,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleNoImmediateEffect, //197 SPELL_AURA_MOD_ATTACKER_SPELL_AND_WEAPON_CRIT_CHANCE implemented in Unit::SpellCriticalBonus Unit::GetUnitCriticalChance
&Aura::HandleUnused, //198 unused (3.0.8a) old SPELL_AURA_MOD_ALL_WEAPON_SKILLS
&Aura::HandleNoImmediateEffect, //199 SPELL_AURA_MOD_INCREASES_SPELL_PCT_TO_HIT implemented in Unit::MagicSpellHitResult
&Aura::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::GiveXP
&Aura::HandleNoImmediateEffect, //200 SPELL_AURA_MOD_XP_PCT implemented in Player::RewardPlayerAndGroupAtKill
&Aura::HandleAuraAllowFlight, //201 SPELL_AURA_FLY this aura enable flight mode...
&Aura::HandleNoImmediateEffect, //202 SPELL_AURA_CANNOT_BE_DODGED implemented in Unit::RollPhysicalOutcomeAgainst
&Aura::HandleNoImmediateEffect, //203 SPELL_AURA_MOD_ATTACKER_MELEE_CRIT_DAMAGE implemented in Unit::CalculateMeleeDamage and Unit::CalculateSpellDamage
@@ -344,7 +344,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]=
&Aura::HandleUnused, //288 unused
&Aura::HandleUnused, //289 unused
&Aura::HandleNULL, //290 mod all critical hit chances?
&Aura::HandleNULL, //291 SPELL_AURA_MOD_XP_QUEST_PCT
&Aura::HandleNoImmediateEffect, //291 SPELL_AURA_MOD_XP_QUEST_PCT implemented in Player::RewardQuest
&Aura::HandleNULL, //292 call stabled pet
&Aura::HandleNULL, //293 2 test spells
&Aura::HandleNULL //294 2 spells, possible prevent mana regen