aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp60
-rw-r--r--src/game/Player.cpp23
2 files changed, 48 insertions, 35 deletions
diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp
index 87033b9899f..7e02091d11d 100644
--- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp
+++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp
@@ -58,6 +58,7 @@ struct TRINITY_DLL_DECL npc_crusade_persuadedAI : public ScriptedAI
uiSpeech_counter = 0;
uiPlayerGUID = 0;
me->SetReactState(REACT_AGGRESSIVE);
+ me->RestoreFaction();
}
void SpellHit(Unit *caster, const SpellEntry *spell)
@@ -66,36 +67,34 @@ struct TRINITY_DLL_DECL npc_crusade_persuadedAI : public ScriptedAI
{
if(CAST_PLR(caster)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE)
{
- if (rand()%100 < 5) // chance
- {
- uiPlayerGUID = caster->GetGUID();
- uiSpeech_timer = 1000;
- uiSpeech_counter = 1;
- me->setFaction(35);
- me->CombatStop(true);
- me->GetMotionMaster()->MoveIdle();
- me->SetReactState(REACT_PASSIVE);
+ uiPlayerGUID = caster->GetGUID();
+ uiSpeech_timer = 1000;
+ uiSpeech_counter = 1;
+ me->setFaction(caster->getFaction());
+ me->CombatStop(true);
+ me->GetMotionMaster()->MoveIdle();
+ me->SetReactState(REACT_PASSIVE);
+ DoCastAOE(58111, true);
- switch(rand()%6)
- {
- case 0: DoScriptText(SAY_PERSUADE1, caster);break;
- case 1: DoScriptText(SAY_PERSUADE2, caster);break;
- case 2: DoScriptText(SAY_PERSUADE3, caster);break;
- case 3: DoScriptText(SAY_PERSUADE4, caster);break;
- case 4: DoScriptText(SAY_PERSUADE5, caster);break;
- case 5: DoScriptText(SAY_PERSUADE6, caster);break;
- case 6: DoScriptText(SAY_PERSUADE7, caster);break;
- }
+ switch(rand()%6)
+ {
+ case 0: DoScriptText(SAY_PERSUADE1, caster);break;
+ case 1: DoScriptText(SAY_PERSUADE2, caster);break;
+ case 2: DoScriptText(SAY_PERSUADE3, caster);break;
+ case 3: DoScriptText(SAY_PERSUADE4, caster);break;
+ case 4: DoScriptText(SAY_PERSUADE5, caster);break;
+ case 5: DoScriptText(SAY_PERSUADE6, caster);break;
+ case 6: DoScriptText(SAY_PERSUADE7, caster);break;
+ }
- switch(rand()%5)
- {
- case 0: DoScriptText(SAY_CRUSADER1, me);break;
- case 1: DoScriptText(SAY_CRUSADER2, me);break;
- case 2: DoScriptText(SAY_CRUSADER3, me);break;
- case 3: DoScriptText(SAY_CRUSADER4, me);break;
- case 4: DoScriptText(SAY_CRUSADER5, me);break;
- case 5: DoScriptText(SAY_CRUSADER6, me);break;
- }
+ switch(rand()%5)
+ {
+ case 0: DoScriptText(SAY_CRUSADER1, me);break;
+ case 1: DoScriptText(SAY_CRUSADER2, me);break;
+ case 2: DoScriptText(SAY_CRUSADER3, me);break;
+ case 3: DoScriptText(SAY_CRUSADER4, me);break;
+ case 4: DoScriptText(SAY_CRUSADER5, me);break;
+ case 5: DoScriptText(SAY_CRUSADER6, me);break;
}
}
}
@@ -122,17 +121,16 @@ struct TRINITY_DLL_DECL npc_crusade_persuadedAI : public ScriptedAI
case 4: DoScriptText(SAY_PERSUADED4, me); uiSpeech_timer = 8000; break;
case 5: DoScriptText(SAY_PERSUADED5, pPlayer); uiSpeech_timer = 8000; break;
case 6: DoScriptText(SAY_PERSUADED6, me);
- me->RestoreFaction();
pPlayer->Kill(me);
//me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
//me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
uiSpeech_counter = 0;
- if(pPlayer->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE)
- pPlayer->AreaExploredOrEventHappens(12720);
+ pPlayer->GroupEventHappens(12720, me);
return;
}
++uiSpeech_counter;
+ DoCastAOE(58111, true);
}else uiSpeech_timer -= diff;
return;
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 8c0843385d2..942c5179778 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -7334,6 +7334,18 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32
if(spellData.SpellPPMRate)
{
+ if(spellData.SpellId == 52781) // Persuasive Strike
+ {
+ switch(target->GetEntry())
+ {
+ default:
+ return;
+ case 28939:
+ case 28940:
+ case 28610:
+ break;
+ }
+ }
uint32 WeaponSpeed = GetAttackTime(attType);
chance = GetPPMProcChance(WeaponSpeed, spellData.SpellPPMRate, spellInfo);
}
@@ -7383,10 +7395,13 @@ void Player::CastItemCombatSpell(Unit *target, WeaponAttackType attType, uint32
float chance = pEnchant->amount[s] != 0 ? float(pEnchant->amount[s]) : GetWeaponProcChance();
- if (entry && entry->PPMChance)
- chance = GetPPMProcChance(proto->Delay, entry->PPMChance, spellInfo);
- else if (entry && entry->customChance)
- chance = entry->customChance;
+ if (entry)
+ {
+ if(entry->PPMChance)
+ chance = GetPPMProcChance(proto->Delay, entry->PPMChance, spellInfo);
+ else if(entry->customChance)
+ chance = entry->customChance;
+ }
// Apply spell mods
ApplySpellMod(pEnchant->spellid[s],SPELLMOD_CHANCE_OF_SUCCESS,chance);