virusav
23.02.2011, 11:07
Тема на форуме СД2: http://www.scriptdev2.com/project.php?issueid=1147
Index: scripts/world/spell_scripts.cpp
================================================== =================
--- scripts/world/spell_scripts.cpp (revision 1976)
+++ scripts/world/spell_scripts.cpp (working copy)
@@ -36,6 +36,9 @@
spell 45111
spell 39246
spell 52090
+spell 51331
+spell 51332
+spell 51366
EndContentData */
#include "precompiled.h"
@@ -268,7 +271,24 @@
// quest 12659, item 38731
SPELL_AHUNAES_KNIFE = 52090,
- NPC_SCALPS_KILL_CREDIT_BUNNY = 28622
+ NPC_SCALPS_KILL_CREDIT_BUNNY = 28622,
+
+ // quest 12589, item 38573
+ SPELL_HIT_APPLE = 51331,
+ SPELL_MISS_APPLE = 51332,
+ SPELL_MISS_APPLE_HIT_BIRD = 51366,
+ SPELL_APPLE_FALLS_TO_GROUND = 51371,
+ NPC_APPLE = 28053,
+ NPC_LUCKY_WILHELM = 28054,
+ NPC_DROSTAN = 28328,
+ SAY_LUCKY_WILHELM_1 = -1000007,
+ SAY_LUCKY_WILHELM_2 = -1000008,
+ SAY_LUCKY_WILHELM_3 = -1000009,
+ SAY_LUCKY_WILHELM_4 = -1000010,
+ SAY_DROSTAN_1 = -1000011,
+ SAY_DROSTAN_2 = -1000012,
+ SAY_DROSTAN_3 = -1000013,
+ SAY_DROSTAN_4 = -1000014
};
bool EffectAuraDummy_spell_aura_dummy_npc(const Aura* pAura, bool bApply)
@@ -755,6 +775,41 @@
}
return true;
}
+ case SPELL_HIT_APPLE:
+ {
+ pCreatureTarget->CastSpell(pCreatureTarget, SPELL_APPLE_FALLS_TO_GROUND, true);
+ if (Creature* pLuckyWilhelm = GetClosestCreatureWithEntry(pCreatureTarget, NPC_LUCKY_WILHELM, 2*INTERACTION_DISTANCE))
+ DoScriptText(SAY_LUCKY_WILHELM_4, pLuckyWilhelm);
+
+ ((Player*)pCaster)->KilledMonsterCredit(NPC_APPLE);
+ pCreatureTarget->ForcedDespawn(100);
+ return true;
+ }
+ case SPELL_MISS_APPLE:
+ {
+ switch (urand(1, 3))
+ {
+ case 1: DoScriptText(SAY_LUCKY_WILHELM_1, pCreatureTarget); break;
+ case 2: DoScriptText(SAY_LUCKY_WILHELM_2, pCreatureTarget); break;
+ case 3: DoScriptText(SAY_LUCKY_WILHELM_3, pCreatureTarget); break;
+ }
+ if (Creature* pDrostan = GetClosestCreatureWithEntry(pCreatureTarget, NPC_DROSTAN, 4*INTERACTION_DISTANCE))
+ {
+ switch (urand(1, 4))
+ {
+ case 1: DoScriptText(SAY_DROSTAN_1, pDrostan); break;
+ case 2: DoScriptText(SAY_DROSTAN_2, pDrostan); break;
+ case 3: DoScriptText(SAY_DROSTAN_3, pDrostan); break;
+ case 4: DoScriptText(SAY_DROSTAN_4, pDrostan); break;
+ }
+ }
+ return true;
+ }
+ case SPELL_MISS_APPLE_HIT_BIRD:
+ {
+ pCreatureTarget->DealDamage(pCreatureTarget, pCreatureTarget->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ return true;
+ }
}
return false;
Для базы:
1. mangos:
UPDATE `creature_template` SET `scriptname`='spell_dummy_npc' WHERE `entry` IN (28053,28054,28093);
2. SD2:
INSERT INTO `script_texts` (`entry`, `content_default`, `comment`) VALUES
(-1000007, 'Ouch! That\'s it, I quit the target business!', 'SAY_LUCKY_WILHELM_1'),
(-1000008, 'My ear! You grazed my ear!', 'SAY_LUCKY_WILHELM_2'),
(-1000009, 'Not the \'stache! Now I\'m asymmetrical!', 'SAY_LUCKY_WILHELM_3'),
(-1000010, 'Good shot!', 'SAY_LUCKY_WILHELM_4'),
(-1000011, 'Stop whining. You\'ve still got your luck.', 'SAY_DROSTAN_1'),
(-1000012, 'Bah, it\'s an improvement.', 'SAY_DROSTAN_2'),
(-1000013, 'Calm down lad, it\'s just a birdshot!', 'SAY_DROSTAN_3'),
(-1000014, 'The only thing hurt is your pride, lad! Buck up!', 'SAY_DROSTAN_4');
3. mangos (дополнительно):
DELETE FROM `item_required_target` WHERE `entry`=38573;
INSERT INTO `item_required_target` SET `entry`=38573, `type`=1, `targetentry`=28054;
UPDATE `quest_template` SET `reqspellcast1`=0 WHERE `entry`=12589;
DELETE FROM `gameobject` WHERE `id`=190554;
DELETE FROM `spell_script_target` WHERE `entry` IN (51331,51332,51366);
INSERT INTO `spell_script_target` VALUES
(51331,1,28053),
(51332,1,28054),
(51366,1,28093);
Index: scripts/world/spell_scripts.cpp
================================================== =================
--- scripts/world/spell_scripts.cpp (revision 1976)
+++ scripts/world/spell_scripts.cpp (working copy)
@@ -36,6 +36,9 @@
spell 45111
spell 39246
spell 52090
+spell 51331
+spell 51332
+spell 51366
EndContentData */
#include "precompiled.h"
@@ -268,7 +271,24 @@
// quest 12659, item 38731
SPELL_AHUNAES_KNIFE = 52090,
- NPC_SCALPS_KILL_CREDIT_BUNNY = 28622
+ NPC_SCALPS_KILL_CREDIT_BUNNY = 28622,
+
+ // quest 12589, item 38573
+ SPELL_HIT_APPLE = 51331,
+ SPELL_MISS_APPLE = 51332,
+ SPELL_MISS_APPLE_HIT_BIRD = 51366,
+ SPELL_APPLE_FALLS_TO_GROUND = 51371,
+ NPC_APPLE = 28053,
+ NPC_LUCKY_WILHELM = 28054,
+ NPC_DROSTAN = 28328,
+ SAY_LUCKY_WILHELM_1 = -1000007,
+ SAY_LUCKY_WILHELM_2 = -1000008,
+ SAY_LUCKY_WILHELM_3 = -1000009,
+ SAY_LUCKY_WILHELM_4 = -1000010,
+ SAY_DROSTAN_1 = -1000011,
+ SAY_DROSTAN_2 = -1000012,
+ SAY_DROSTAN_3 = -1000013,
+ SAY_DROSTAN_4 = -1000014
};
bool EffectAuraDummy_spell_aura_dummy_npc(const Aura* pAura, bool bApply)
@@ -755,6 +775,41 @@
}
return true;
}
+ case SPELL_HIT_APPLE:
+ {
+ pCreatureTarget->CastSpell(pCreatureTarget, SPELL_APPLE_FALLS_TO_GROUND, true);
+ if (Creature* pLuckyWilhelm = GetClosestCreatureWithEntry(pCreatureTarget, NPC_LUCKY_WILHELM, 2*INTERACTION_DISTANCE))
+ DoScriptText(SAY_LUCKY_WILHELM_4, pLuckyWilhelm);
+
+ ((Player*)pCaster)->KilledMonsterCredit(NPC_APPLE);
+ pCreatureTarget->ForcedDespawn(100);
+ return true;
+ }
+ case SPELL_MISS_APPLE:
+ {
+ switch (urand(1, 3))
+ {
+ case 1: DoScriptText(SAY_LUCKY_WILHELM_1, pCreatureTarget); break;
+ case 2: DoScriptText(SAY_LUCKY_WILHELM_2, pCreatureTarget); break;
+ case 3: DoScriptText(SAY_LUCKY_WILHELM_3, pCreatureTarget); break;
+ }
+ if (Creature* pDrostan = GetClosestCreatureWithEntry(pCreatureTarget, NPC_DROSTAN, 4*INTERACTION_DISTANCE))
+ {
+ switch (urand(1, 4))
+ {
+ case 1: DoScriptText(SAY_DROSTAN_1, pDrostan); break;
+ case 2: DoScriptText(SAY_DROSTAN_2, pDrostan); break;
+ case 3: DoScriptText(SAY_DROSTAN_3, pDrostan); break;
+ case 4: DoScriptText(SAY_DROSTAN_4, pDrostan); break;
+ }
+ }
+ return true;
+ }
+ case SPELL_MISS_APPLE_HIT_BIRD:
+ {
+ pCreatureTarget->DealDamage(pCreatureTarget, pCreatureTarget->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
+ return true;
+ }
}
return false;
Для базы:
1. mangos:
UPDATE `creature_template` SET `scriptname`='spell_dummy_npc' WHERE `entry` IN (28053,28054,28093);
2. SD2:
INSERT INTO `script_texts` (`entry`, `content_default`, `comment`) VALUES
(-1000007, 'Ouch! That\'s it, I quit the target business!', 'SAY_LUCKY_WILHELM_1'),
(-1000008, 'My ear! You grazed my ear!', 'SAY_LUCKY_WILHELM_2'),
(-1000009, 'Not the \'stache! Now I\'m asymmetrical!', 'SAY_LUCKY_WILHELM_3'),
(-1000010, 'Good shot!', 'SAY_LUCKY_WILHELM_4'),
(-1000011, 'Stop whining. You\'ve still got your luck.', 'SAY_DROSTAN_1'),
(-1000012, 'Bah, it\'s an improvement.', 'SAY_DROSTAN_2'),
(-1000013, 'Calm down lad, it\'s just a birdshot!', 'SAY_DROSTAN_3'),
(-1000014, 'The only thing hurt is your pride, lad! Buck up!', 'SAY_DROSTAN_4');
3. mangos (дополнительно):
DELETE FROM `item_required_target` WHERE `entry`=38573;
INSERT INTO `item_required_target` SET `entry`=38573, `type`=1, `targetentry`=28054;
UPDATE `quest_template` SET `reqspellcast1`=0 WHERE `entry`=12589;
DELETE FROM `gameobject` WHERE `id`=190554;
DELETE FROM `spell_script_target` WHERE `entry` IN (51331,51332,51366);
INSERT INTO `spell_script_target` VALUES
(51331,1,28053),
(51332,1,28054),
(51366,1,28093);