[Wip] The Liquid Fire Of Elune (12166)

Quest Credit is not given, any idea why?

[CODE]SET @SPELL := 46770; – Liquid Fire of Elune
SET @ITEM := 36956; – Liquid Fire of Elune (item)
SET @QUEST := 12166; – this()

– Rabid Grizzly
SET @ENTRY := 26643;
SET @CREDIT_BUNNY := 27112; – Rabid Grizzly Liquid Fire of Elune Kill Credit Bunny

UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM smart_scripts WHERE source_type=0 AND entryorguid=@ENTRY;
DELETE FROM smart_scripts WHERE source_type=9 AND entryorguid=@ENTRY100;
INSERT INTO smart_scripts (entryorguid,source_type,id,link,event_type,event_phase_mask,event_chance,event_flags,event_param1,event_param2,event_param3,event_param4,action_type,action_param1,action_param2,action_param3,action_param4,action_param5,action_param6,target_type,target_param1,target_param2,target_param3,target_x,target_y,target_z,target_o,comment) VALUES
(@ENTRY,0,0,0,8,1,100,0,@SPELL,0,0,0,80,@ENTRY
100,0,0,0,0,0,1,0,0,0,0,0,0,0,‘On spell hit run script’),
(@ENTRY100,9,0,0,0,0,100,0,1000,1000,0,0,16,@QUEST,@CREDIT_BUNNY,0,0,0,0,7,0,0,0,0,0,0,0,‘Give quest credit’),
(@ENTRY
100,9,1,0,0,0,100,0,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Despawn’);

DELETE FROM conditions WHERE SourceEntry=@ITEM AND ConditionValue2=@ENTRY;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,Comment) VALUES
(18,0,@ITEM,0,24,2,@ENTRY,‘Liquid Fire of Elune can only be used on Rabid Grizzly’);

– Blighted Elk
SET @ENTRY := 26616;
SET @CREDIT_BUNNY := 27111; – Blighted Elk Liquid Fire of Elune Kill Credit Bunny

UPDATE creature_template SET AIName=‘SmartAI’ WHERE entry=@ENTRY;
DELETE FROM smart_scripts WHERE source_type=0 AND entryorguid=@ENTRY;
DELETE FROM smart_scripts WHERE source_type=9 AND entryorguid=@ENTRY100;
INSERT INTO smart_scripts (entryorguid,source_type,id,link,event_type,event_phase_mask,event_chance,event_flags,event_param1,event_param2,event_param3,event_param4,action_type,action_param1,action_param2,action_param3,action_param4,action_param5,action_param6,target_type,target_param1,target_param2,target_param3,target_x,target_y,target_z,target_o,comment) VALUES
(@ENTRY,0,0,0,8,1,100,0,@SPELL,0,0,0,80,@ENTRY
100,0,0,0,0,0,1,0,0,0,0,0,0,0,‘On spell hit run script’),
(@ENTRY100,9,0,0,0,0,100,0,1000,1000,0,0,16,@QUEST,@CREDIT_BUNNY,0,0,0,0,7,0,0,0,0,0,0,0,‘Give quest credit’),
(@ENTRY
100,9,1,0,0,0,100,0,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘despawn’);

DELETE FROM conditions WHERE SourceEntry=@ITEM AND ConditionValue2=@ENTRY;
INSERT INTO conditions (SourceTypeOrReferenceId,SourceGroup,SourceEntry,ElseGroup,ConditionTypeOrReference,ConditionValue1,ConditionValue2,Comment) VALUES
(18,0,@ITEM,0,24,2,@ENTRY,‘Liquid Fire of Elune can only be used on Blighted Elk’);
[/sql][/CODE]

Do you realize that they do not despawn ether? Might be because they are already dead when you cast them.

And as for the credits, you are using SMART_ACTION_SEND_CASTCREATUREORGO. You should use SMART_ACTION_CALL_KILLEDMONSTER. /emoticons/default_smile.png

I’ll post a fix in a second.

EDIT.

Sorry mate, apparently it doesn’t work if an NPC is dead and you hit it with a spell… =/ I’ll do some more research…

Update:

Apparently it DID work with EventAI… Quest 14077 creature 34852. =/

Check if the npc is dead or only looks dead. Maby the flags need adjusting.

I already made a fix for that.

http://www.trinityco…-fire-of-elune/

I’m not submitting it because the visual is missing. Too lazy to add it, although easy.

@Svannon: The NPCs HAVE to be dead.

Quoting odds they only look dead.

The visuals are there for me. I tested without any of those two changes and with, and they are still there…

Why does the credit part work for you though? =/ Maybe timed action lists can’t be called if NPC is dead?

EDIT

Nevermind, no credits on your scripts either…

Need need for a timed actionlist here. I just give the bunny KC on spellhiy and link to dispel.

@Discover: Retested quite recently, and I still don’t see the visual… You sure you have a clean core / DB ?

My code is based on: http://www.trinityco…locked-objects/. I’m trying to make a sniff on offy tonight.

@Cron: I see the visuals too, definitly a clean Core and DB.

Edit: patch 4.2.2. (14545) came out today; sniffer doesn’t work with it (yet). /emoticons/default_sad.png

I am sure I have a a clean database and core. How about you? /emoticons/default_tongue.png

Noticed my typos, i meant despawn, not dispel.

About credits, i get them.

How is that even possible… =/

No idea. I basically run

.reload smart_scripts

.reload creature_template X

.npc add X

after having executed the SQLs, then i test on the spawned npc, as it wont work on any other npc spawned since their template is not really reloaded.

Btw, tested on a clean core at tip. No visual. WTF.

I bet it’s a very basic issue we are overlooking right now… Just no idea what!

make sure you have no EAI scripts, theres a bug that runs EAI scripts if present even if the ainame is changed.

Hm, that’s new for me. It indeed has EAI for me as well. I’ll try in a minute.

Yeah, now there indeed is no visual, but no credits either… =P

Correct. Changing the SQL statement in [SIZE=14px]CreatureEventAIMgr::LoadCreatureEventAI_Scripts() [/SIZE]might fix it (only loads EventAI for a creature when EventAI is set):

SELECT id, creature_id, event_type, event_inverse_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action1_type, action1_param1, action1_param2, action1_param3, action2_type, action2_param1, action2_param2, action2_param3, action3_type, action3_param1, action3_param2, action3_param3 FROM creature_ai_scripts ai, creature_template ct WHERE ai.`creature_id` = ct.`entry` AND ct.`AIName` = 'EventAI'[/sql]

Edit:

executing

[sql]SELECT ct.entry, ct.name FROM creature_ai_scripts ai, creature_template ct WHERE ai.creature_id = ct.entry AND ct.AIName = ‘SmartAI’
against my world.db results in 3xBlighted Elk and 3xRabid Grizzly

Oh true, there’s an EAI on my db too.

OK So. The snippet above gives me the killcredit. Commands ran to test:

.reload creature_ai_scripts

.reload smart_scripts

.reload creature_template 26643

.reload creature_template 26616

.npc add 26643

(Target the NPC)

.damage 25000000

(Use the item, get the credit, profit)

[CODE]-- Fix quest 12166: The Liquid Fire Of Elune
SET @SPELL := 46770;
SET @VISUAL := 47972;
SET @ITEM := 36956;
SET @ELK := 26616;
SET @GRIZZLY := 26643;
SET @ELKDUMMY = 27111;
SET @GRIZZLYDUMMY = 27112;
UPDATE creature_template SET AIName = ‘SmartAI’ WHERE entry IN (@ELK, @GRIZZLY);
DELETE FROM smart_scripts WHERE entryorguid=@ELK AND source_type=0;
DELETE FROM smart_scripts WHERE entryorguid=@GRIZZLY AND source_type=0;
DELETE FROM creature_ai_scripts WHERE id IN (2661601,2661602,2661603,2664301,2664302,2664303);
INSERT INTO smart_scripts (entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment) VALUES
(@GRIZZLY,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@GRIZZLYDUMMY,0,0,0,0,0,7,0,0,0,0,0,0,0,‘Rabid Grizzly - On spell hit - Give kill credit for quest 12166’),
(@GRIZZLY,0,1,0,61,0,100,1,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Rabid Grizzly - Despawn after 5 seconds’),
(@ELK,0,0,1,8,0,100,0x01,@SPELL,0,0,0,33,@ELKDUMMY,0,0,0,0,0,7,0,0,0,0,0,0,0, ‘Blighted Elk - On spell hit - Give kill credit for quest 12166’),
(@ELK,0,1,0,61,0,100,1,0,0,0,0,41,5000,0,0,0,0,0,1,0,0,0,0,0,0,0, ‘Blighted Elk - Despawn after 5 secondes’);[/sql]
Issue left: not despawning. Core side issue.

EDIT: Doubt they should despawn afaik, we would have no time to loot them then …

[/CODE]

Fixed in https://github.com/TrinityCore/TrinityCore/commit/b031f2f595d4209612ecd5b7fcec45de1e97438c

Thanks tharaca.