This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [SOLVED][ELUNA][TC 3.3.5] Game_event_condition system  (Read 1345 times)

Makpptfox

  • Contributors
  • Loreweaver
  • *****
  • Posts: 103
    • View Profile
[SOLVED][ELUNA][TC 3.3.5] Game_event_condition system
« on: March 31, 2017, 04:13:56 am »
Hello guys,

I wanted to create some interactives events (like Ahhn'Qiraj war effort in classic or Shattered sun offensive in tbc) and I got a look at Game_event_condition and Game_event_quest_condition, first, they're empty in TLK 3.3.5 for TrinityCore but let's be honest, it doesn't look that hard.

So first I created a Game_Event for the test with the ID 35 (nothing is here for me)
I have set the "world_event" field on 1, and I have added some random big fires into the event, to get a visual information if Yes or No the event is active.

Then I used an old quest (entry : 66016) wich is repeteable as a quest reference for Game_event_quest_condition and I filled the fields like that :

Code: [Select]
eventEntry = 35 | quest = 66016 | condition_id = 50 | num = 1
Then same goes for Game_event_condition like that :

Code: [Select]
eventEntry = 35 | condition_id = 50 | req_num = 2 | max_world_state_field = 4000 | done_world_state_field = 5000 | description = test
And when I restart the server and try to go on the NPC to do the quest : Nothing.

With the informations i've added in the tables, I should see the event 35 appear when I complete the quest 66016 two times.

But even if I complete it one time and go into the Characters.game_event_save, it's empty...

I tried many things without any ideas and Google is pretty cheap in informations about the Game_event_condition system, I even installed a Vanilla and TBC database to check on it if something was going to help me but.. Nope.


So, if someone know anything about that, it would be pretty neat to be able to understand how it works, or why it didn't.. At this point I'll take everything.


Regards !




[EDIT : Solved through eluna code]
« Last Edit: June 08, 2018, 11:15:07 am by Makpptfox »
For support, send your Discord's ID by PM.

Makpptfox

  • Contributors
  • Loreweaver
  • *****
  • Posts: 103
    • View Profile
Re: [TC 3.3.5] Game_event_condition system
« Reply #1 on: April 08, 2017, 07:15:56 pm »
And, here's a shameful up.

Still not able to make it work.
For support, send your Discord's ID by PM.

Makpptfox

  • Contributors
  • Loreweaver
  • *****
  • Posts: 103
    • View Profile
[SOLVED][ELUNA][TC 3.3.5] Game_event_condition system
« Reply #2 on: June 08, 2018, 11:13:48 am »
Necroing that post;

I haven't found out any way to do it on the basecore (trinitycore) but it is possible via some hack with Eluna.

For references :

I added a new table - for test purposes - in my DB named "game_event_eluna"



from that I spawned creatures with ID 66030 on my server, the point of my test was to start or stop an event from a reached amount of killed creatures.

I've set the event_cont01 to 95 simply because I don't want to kill 100 creatures to test my event :D

Here's the code part

Code: [Select]
-- Test conditions
local function EVENT_INCR_POS_TEST(event, killer, killed)
local Ghoul = killed:GetEntry()
local Q = WorldDBQuery("SELECT * FROM game_event_eluna WHERE event_ID=1")
local IncrCheck = Q:GetFloat(2)
local TotalCheck = Q:GetFloat(3)
local IncrDB = Q:GetFloat(2) +1
local GE_Active = IsGameEventActive(90)
if Ghoul == 66030 then
if IncrCheck ~= TotalCheck then
WorldDBQuery("UPDATE `game_event_eluna` SET `event_cont01`='"..IncrDB.."' WHERE (`event_ID`='1')")
killer:Say("Test de la premiere colonne >"..IncrDB.."<", 0)
killer:Say("Test de la seconde colonne >"..TotalCheck.."<", 0)
elseif IncrCheck == TotalCheck and (GE_Active == false) then
killer:Say("Test start d'event", 0)
StartGameEvent(90,true)
end
end
end

RegisterPlayerEvent(7, EVENT_INCR_POS_TEST)

Each kill of the creature increment the event_cont01, once event_cont01 is equal to event_cont02 it's starting the game_event.

It's maybe not the cleanest code you'll see, but it does the work and it's easily editable to adapt it to multiple purposes.


Regards.
« Last Edit: June 08, 2018, 11:24:21 am by Makpptfox »
For support, send your Discord's ID by PM.