PDA

Просмотр полной версии : [achivement=1687]Пусть сильнее грянет вьюга!


MuTaToR
01.04.2010, 22:56
Для ачивки нужны снежки, их можно получить при поцелуи гуляки.

http://www.scriptdev2.com/project.php?issueid=793

Index: scripts/world/npcs_special.cpp
================================================== =================
--- scripts/world/npcs_special.cpp (revision 1513)
+++ scripts/world/npcs_special.cpp (working copy)
@@ -1727,7 +1727,52 @@
}
return true;
}
+/*###
+##npc_winter_reveler
+###*/
+enum
+{
+ AURA_MISTLETOE = 26218,
+ SPELL_CREATE_SNOWFLAKES = 45036,
+ SPELL_FRESH_HOLLY = 26207,
+ SPELL_MISTLETOE = 26206
+};

+struct MANGOS_DLL_DECL npc_winter_revelerAI : public ScriptedAI
+{
+ npc_winter_revelerAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); }
+
+ void Reset() {}
+
+ void ReceiveEmote(Player* pPlayer, uint32 emote)
+ {
+ if (emote == TEXTEMOTE_KISS)
+ {
+ if(!pPlayer->HasAura(AURA_MISTLETOE))
+ {
+ switch(rand()%3)
+ {
+ case 0:
+ pPlayer->CastSpell(pPlayer,SPELL_CREATE_SNOWFLAKES,true);
+ break;
+ case 1:
+ pPlayer->CastSpell(pPlayer,SPELL_FRESH_HOLLY,true);
+ break;
+ case 2:
+ pPlayer->CastSpell(pPlayer,SPELL_MISTLETOE,true);
+ break;
+ }
+ pPlayer->CastSpell(pPlayer,AURA_MISTLETOE,true);
+ }
+ }
+ }
+};
+
+CreatureAI* GetAI_npc_winter_reveler(Creature* pCreature)
+{
+ return new npc_winter_revelerAI(pCreature);
+}
+
void AddSC_npcs_special()
{
Script* newscript;
@@ -1817,4 +1862,9 @@
newscript->pGossipHello = &GossipHello_npc_locksmith;
newscript->pGossipSelect = &GossipSelect_npc_locksmith;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_winter_reveler";
+ newscript->GetAI = &GetAI_npc_winter_reveler;
+ newscript->RegisterSelf();
}

Дополнительные запросы:

UPDATE `creature_template` SET `ScriptName` = 'npc_winter_reveler ' WHERE `entry` = 15760;