Permalink
Browse files

misc

  • Loading branch information...
1 parent 61b9d2d commit 8c4f06d973628880dfb503f14034896c3dbc97a8 @Reamer committed Apr 13, 2012
Showing with 186 additions and 71 deletions.
  1. +28 −1 scripts/world/areatrigger_scripts.cpp
  2. +141 −3 scripts/world/npcs_special.cpp
  3. +15 −65 scripts/world/spell_scripts.cpp
  4. +1 −1 sd2_revision_R2.h
  5. +1 −1 sd2_revision_nr.h
@@ -17,7 +17,7 @@
/* ScriptData
SDName: Areatrigger_Scripts
SD%Complete: 100
-SDComment: Quest support: 6681, 11686, 10589/10604, 12741, 12548, 13315/13351, 12575
+SDComment: Quest support: 4291, 6681, 11686, 10589/10604, 12741, 12548, 13315/13351, 12575
SDCategory: Areatrigger
EndScriptData */
@@ -30,6 +30,7 @@ at_spearborn_encampment 5030
at_warsong_farms
at_stormwright_shelf 5108
at_childrens_week_spot 3546,3547,3548,3552,3549,3550
+at_scent_larkorwi 1726,1727,1728,1729,1730,1731,1732,1733,1734,1735,1736,1737,1738,1739,1740
EndContentData */
#include "precompiled.h"
@@ -259,6 +260,27 @@ bool AreaTrigger_at_stormwright_shelf(Player* pPlayer, AreaTriggerEntry const* p
return true;
}
+/*######
+## at_scent_larkorwi
+######*/
+
+enum
+{
+ QUEST_SCENT_OF_LARKORWI = 4291,
+ NPC_LARKORWI_MATE = 9683
+};
+
+bool AreaTrigger_at_scent_larkorwi(Player* pPlayer, AreaTriggerEntry const* pAt)
+{
+ if (pPlayer->isAlive() && !pPlayer->isGameMaster() && pPlayer->GetQuestStatus(QUEST_SCENT_OF_LARKORWI) == QUEST_STATUS_INCOMPLETE)
+ {
+ if (!GetClosestCreatureWithEntry(pPlayer, NPC_LARKORWI_MATE, 25.0f, false, false))
+ pPlayer->SummonCreature(NPC_LARKORWI_MATE, pAt->x, pAt->y, pAt->z, 3.3f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 2*MINUTE*IN_MILLISECONDS);
+ }
+
+ return false;
+}
+
void AddSC_areatrigger_scripts()
{
Script* pNewScript;
@@ -307,4 +329,9 @@ void AddSC_areatrigger_scripts()
pNewScript->Name = "at_stormwright_shelf";
pNewScript->pAreaTrigger = &AreaTrigger_at_stormwright_shelf;
pNewScript->RegisterSelf();
+
+ pNewScript = new Script;
+ pNewScript->Name = "at_scent_larkorwi";
+ pNewScript->pAreaTrigger = &AreaTrigger_at_scent_larkorwi;
+ pNewScript->RegisterSelf();
}
@@ -608,12 +608,13 @@ struct MANGOS_DLL_DECL npc_injured_patientAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//lower HP on every world tick makes it a useful counter, not officlone though
- if (m_creature->isAlive() && m_creature->GetHealth() > 6)
+ uint32 uiHPLose = uint32(0.05f * diff);
+ if (m_creature->isAlive() && m_creature->GetHealth() > 1 + uiHPLose)
{
- m_creature->SetHealth(uint32(m_creature->GetHealth()-5));
+ m_creature->SetHealth(m_creature->GetHealth() - uiHPLose);
}
- if (m_creature->isAlive() && m_creature->GetHealth() <= 6)
+ if (m_creature->isAlive() && m_creature->GetHealth() <= 1 + uiHPLose)
{
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT);
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
@@ -2439,6 +2440,132 @@ CreatureAI* GetAI_npc_shade_of_horseman(Creature* pCreature)
return new npc_shade_of_horsemanAI (pCreature);
};
+/*########
+npc_wild_turkey
+#########*/
+enum
+{
+ EMOTE_TURKEY_HUNTER = -1730001,
+ EMOTE_TURKEY_DOMINATION = -1730002,
+ EMOTE_TURKEY_SLAUGHTER = -1730003,
+ EMOTE_TURKEY_TRIUMPH = -1730004,
+
+ SPELL_TURKEY_TRACKER = 62014,
+ SPELL_PH_KILL_COUNTER_VISUAL_MAX = 62021
+};
+struct MANGOS_DLL_DECL npc_wild_turkeyAI : public ScriptedAI
+{
+ npc_wild_turkeyAI(Creature* pCreature) : ScriptedAI(pCreature)
+ {
+ m_creature->RemoveAllAuras();
+ }
+
+ void Reset(){}
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* pKiller)
+ {
+ if (pKiller && pKiller->GetTypeId() == TYPEID_PLAYER)
+ {
+ pKiller->CastSpell(pKiller, SPELL_TURKEY_TRACKER, true);
+ Aura * pAura = pKiller->GetAura(SPELL_TURKEY_TRACKER, EFFECT_INDEX_0);
+ if (pAura)
+ {
+ uint32 stacks = pAura->GetStackAmount();
+ switch (stacks)
+ {
+ case 10:
+ {
+ DoScriptText(EMOTE_TURKEY_HUNTER, m_creature, pKiller);
+ break;
+ }
+ case 20:
+ {
+ DoScriptText(EMOTE_TURKEY_DOMINATION, m_creature, pKiller);
+ break;
+ }
+ case 30:
+ {
+ DoScriptText(EMOTE_TURKEY_SLAUGHTER, m_creature, pKiller);
+ break;
+ }
+ case 40:
+ {
+ DoScriptText(EMOTE_TURKEY_TRIUMPH, m_creature, pKiller);
+ pKiller->CastSpell(pKiller, SPELL_PH_KILL_COUNTER_VISUAL_MAX, true);
+ break;
+ }
+ default: break;
+ }
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_wild_turkey(Creature* pCreature)
+{
+ return new npc_wild_turkeyAI (pCreature);
+};
+
+/*######
+## npc_experience
+######*/
+
+#define EXP_COST 100000//10 00 00 copper (10golds)
+#define GOSSIP_TEXT_EXP 14736
+#define GOSSIP_XP_OFF "I no longer wish to gain experience."
+#define GOSSIP_XP_ON "I wish to start gaining experience again."
+
+bool GossipHello_npc_experience(Player* pPlayer, Creature* pCreature)
+{
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_XP_OFF, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_XP_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ pPlayer->PlayerTalkClass->SendGossipMenu(GOSSIP_TEXT_EXP, pCreature->GetObjectGuid());
+ return true;
+}
+
+bool GossipSelect_npc_experience(Player* pPlayer, Creature* /*pCreature*/, uint32 /*uiSender*/, uint32 uiAction)
+{
+ bool noXPGain = pPlayer->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);
+ bool doSwitch = false;
+
+ switch(uiAction)
+ {
+ case GOSSIP_ACTION_INFO_DEF + 1://xp off
+ {
+ if (!noXPGain)//does gain xp
+ doSwitch = true;//switch to don't gain xp
+ }
+ break;
+ case GOSSIP_ACTION_INFO_DEF + 2://xp on
+ {
+ if (noXPGain)//doesn't gain xp
+ doSwitch = true;//switch to gain xp
+ }
+ break;
+ }
+ if (doSwitch)
+ {
+ if (pPlayer->GetMoney() < EXP_COST)
+ pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0);
+ else if (noXPGain)
+ {
+ pPlayer->ModifyMoney(-EXP_COST);
+ pPlayer->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);
+ }
+ else if (!noXPGain)
+ {
+ pPlayer->ModifyMoney(-EXP_COST);
+ pPlayer->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_XP_USER_DISABLED);
+ }
+ }
+ pPlayer->PlayerTalkClass->CloseGossip();
+ return true;
+}
void AddSC_npcs_special()
{
@@ -2567,4 +2694,15 @@ void AddSC_npcs_special()
pNewScript->Name = "npc_shade_of_horseman";
pNewScript->GetAI = &GetAI_npc_shade_of_horseman;
pNewScript->RegisterSelf();
+
+ pNewScript = new Script;
+ pNewScript->Name = "npc_wild_turkey";
+ pNewScript->GetAI = &GetAI_npc_wild_turkey;
+ pNewScript->RegisterSelf();
+
+ pNewScript = new Script;
+ pNewScript->Name = "npc_experience";
+ pNewScript->pGossipHello = &GossipHello_npc_experience;
+ pNewScript->pGossipSelect = &GossipSelect_npc_experience;
+ pNewScript->RegisterSelf();
}
@@ -40,6 +40,7 @@ spell 51331
spell 51332
spell 51366
spell 43340
+spell 48218
EndContentData */
#include "precompiled.h"
@@ -249,27 +250,12 @@ enum
NPC_DARKSPINE_MYRMIDON = 25060,
NPC_DARKSPINE_SIREN = 25073,
- // quest 14107
- SPELL_BLESSING_OF_PEACE = 66719,
- NPC_FALLEN_HERO_SPIRIT = 32149,
- NPC_FALLEN_HERO_SPIRIT_PROXY = 35055,
- SAY_BLESS_1 = -1000594,
- SAY_BLESS_2 = -1000595,
- SAY_BLESS_3 = -1000596,
- SAY_BLESS_4 = -1000597,
- SAY_BLESS_5 = -1000598,
-
// quest "The Big Bone Worm" 10930
SPELL_FUMPING = 39246,
SPELL_SUMMON_HAISHULUD = 39248,
NPC_SAND_GNOME = 22483,
NPC_MATURE_BONE_SIFTER = 22482,
- // quest 12813, by item 40587
- SPELL_DARKMENDER_TINCTURE = 52741,
- SPELL_SUMMON_CORRUPTED_SCARLET = 54415,
- NPC_CORPSES_RISE_CREDIT_BUNNY = 29398,
-
// quest 12659, item 38731
SPELL_AHUNAES_KNIFE = 52090,
NPC_SCALPS_KILL_CREDIT_BUNNY = 28622,
@@ -315,44 +301,15 @@ enum
SAY_FREE_1 = -1000781,
SAY_FREE_2 = -1000782,
SAY_FREE_3 = -1000783,
+
+ // quest 12213, 12220, item 37173
+ SPELL_SAMPLING_ENERGY = 48218,
};
bool EffectAuraDummy_spell_aura_dummy_npc(const Aura* pAura, bool bApply)
{
switch(pAura->GetId())
{
- case SPELL_BLESSING_OF_PEACE:
- {
- Creature* pCreature = (Creature*)pAura->GetTarget();
-
- if (!pCreature || pCreature->GetEntry() != NPC_FALLEN_HERO_SPIRIT)
- return true;
-
- if (pAura->GetEffIndex() != EFFECT_INDEX_0)
- return true;
-
- if (bApply)
- {
- switch(urand(0, 4))
- {
- case 0: DoScriptText(SAY_BLESS_1, pCreature); break;
- case 1: DoScriptText(SAY_BLESS_2, pCreature); break;
- case 2: DoScriptText(SAY_BLESS_3, pCreature); break;
- case 3: DoScriptText(SAY_BLESS_4, pCreature); break;
- case 4: DoScriptText(SAY_BLESS_5, pCreature); break;
- }
- }
- else
- {
- if (Player* pPlayer = (Player*)pAura->GetCaster())
- {
- pPlayer->KilledMonsterCredit(NPC_FALLEN_HERO_SPIRIT_PROXY, pCreature->GetObjectGuid());
- pCreature->ForcedDespawn();
- }
- }
-
- return true;
- }
case SPELL_HEALING_SALVE:
{
if (pAura->GetEffIndex() != EFFECT_INDEX_0)
@@ -503,24 +460,6 @@ bool EffectDummyCreature_spell_dummy_npc(Unit* pCaster, uint32 uiSpellId, SpellE
}
return true;
}
- case SPELL_DARKMENDER_TINCTURE:
- {
- if (uiEffIndex == EFFECT_INDEX_0)
- {
- if (pCaster->GetTypeId() != TYPEID_PLAYER)
- return true;
-
- // TODO: find/fix visual for effect, no related spells found doing this
-
- pCreatureTarget->CastSpell(pCreatureTarget, SPELL_SUMMON_CORRUPTED_SCARLET, true);
-
- ((Player*)pCaster)->KilledMonsterCredit(NPC_CORPSES_RISE_CREDIT_BUNNY);
-
- pCreatureTarget->ForcedDespawn();
- return true;
- }
- return true;
- }
case SPELL_DISCIPLINING_ROD:
{
if (uiEffIndex == EFFECT_INDEX_0)
@@ -936,6 +875,17 @@ bool EffectDummyCreature_spell_dummy_npc(Unit* pCaster, uint32 uiSpellId, SpellE
}
return true;
}
+ case SPELL_SAMPLING_ENERGY:
+ {
+ if (uiEffIndex == EFFECT_INDEX_0)
+ {
+ if (pCaster->GetTypeId() != TYPEID_PLAYER)
+ return true;
+
+ ((Player*)pCaster)->KilledMonsterCredit(pCreatureTarget->GetEntry());
+ }
+ return true;
+ }
}
return false;
View
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_R2_H__
#define __SD2_REVISION_R2_H__
- #define SD2_REVISION_R2 "0346"
+ #define SD2_REVISION_R2 "0390"
#endif // __SD2_REVISION_R2_H__
View
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_NR_H__
#define __SD2_REVISION_NR_H__
- #define SD2_REVISION_NR "2416"
+ #define SD2_REVISION_NR "2514"
#endif // __SD2_REVISION_NR_H__

0 comments on commit 8c4f06d

Please sign in to comment.