Jump to content

[patch] Some Game Event Extensions


Guest w12x
 Share

Recommended Posts

* What bug does the patch fix? What features does the patch add?

It extends the game event system to be able to handle serverwide events (like aq war effort, shattered sun offensive)

* For which SubVersion revision was the patch created?

6222

* Who has been writing this patch? Please include either forum user names or email addresses.

w12x, thanks to Laizerox and Brian for listing what features are needed

Quick info:

- Each phase of a serverwide event is realised as a separate mangos game event.

- World event phases usually have prerequisite world events that must be completed to start given world event. (e.g. the completion of event id 40 is needed to start event id 41)

A world event might require more than one other events as prerequisite.

World events that do not have prerequisite events are first phases of a serverwide event.

- World events usually have conditions / objectives that must be accomplished to complete given event. (e.g. event id 40 needs 350 resource of wool cloth to be completed)

- World events without prerequisites are considered as starting phases, and as such, can only be started by gm command. (.event start #eventid)

- When the initial phase is manually started, the other phases can be started by players completing the matching (mostly repeatable) quests to gather the needed resources.

- This alone won't make the above mentioned events work, it still needs DB data.

Added tables:

--- characters db:

* game_event_save, game_event_condition_save: contains information about the progress of the events

--- mangos db:

* game_event_condition : contains conditions to meet for the specified game event to be completed. Also contains the world state fields used for reporting the given conditions progress and/or max required value.

* game_event_quest_condition : contains quest -> event, condition mappings. Also contains how much a quest adds to a condition.

* game_event_gameobject_quest : like game_event_creature_quest, but for gameobject questgivers

* game_event_npcflag : npcflags to be added together when the specified event is active for the creature with the given guid

* game_event_prerequisite : events that must have been completed to start the given event

* game_event_npc_gossip : gossipid for the given npc when the specified event is active. It is usually used to report progress by setting this, and the matching world state field.

Added fields to existing tables:

--- mangos db:

* game_event table: added a world_event variable, which must be set to 1 for serverwide events and 0 for "normal" game events.

Other info: there is test data for demonstrating purposes in the archive for shattered sun offensive. The data in there is taken from wowhead, it handles the spawning of the quest giver / vendor npcs during the phases, and the enabling / disabling of quests and npc flags. It assumes that you have the proper spawns already in your database in finished event state, it won't add entries to your creature and gameobject tables, it will only assign the spawns to the matching phases. To use this test data, set the @PHASE1 variable in the second line of the shattered_sun_offensive.sql to equal your maximum previous event id + 1, then run the query.

Things that might be asked here: how to fill the added tables, or how a serverwide event phase entry looks like in game_event table (though the test data sql has comments inside, which should make these clear)

I know that a more detailed explanation might be needed, but really everything can be seen in the source code.

Things that definitely should not be asked here: how to fill the already existing tables, why the ... quest can't be completed. These can be found (for example) in the udb wiki.

Patch (v11)

on filebeam

on sendspace

Link to comment
Share on other sites

  • Replies 112
  • Created
  • Last Reply

Top Posters In This Topic

i'looking into the source - the patch doesn't conflict with the instance system because only a few lines in creature.cpp and object.cpp were modified - i think if the patch works fine (will test it ASAP) a dev can accept it before the instance system will go to svn.

Link to comment
Share on other sites

<div class='quotetop'>QUOTE (wolfdragon @ Jul 5 2008, 04:11 PM) <{POST_SNAPBACK}></div>

Just one question, does this allow a third-party scripting library (such as ScriptDev2) to have access to GameEvents?[/b]

Nope, I didn't find anything that would require that. If there is need for it, that can be part of another patch.

Link to comment
Share on other sites

<div class='quotetop'>QUOTE (Lord X-Press @ Jul 6 2008, 02:02 PM) <{POST_SNAPBACK}></div>

one question, does it go everytime to the next higher EventID?[/b]

Nope. game_event_prerequisite (event_id, prerequisite_event) contains what events must be completed to start a new one. For example:

event_id |    prerequisite_event
4                        |    5
4                        |    6

then for event 4 to start, you must complete event 5 and 6.

<div class='quotetop'>QUOTE </div>

Think it would be better if you can set the next EventID over the DB, so you can go back to an lower event or build a Eventloop...[/b]

Event loops are not supported, and there is no world event that requires that (quite obviously, if it can only happen once in realm lifetime, why would it loop?). If you want reoccuring events, use normal game events.

Link to comment
Share on other sites

<div class='quotetop'>QUOTE (w12x @ Jul 6 2008, 02:39 PM) <{POST_SNAPBACK}></div>

Nope. game_event_prerequisite (event_id, prerequisite_event) contains what events must be completed to start a new one. For example:

event_id |    prerequisite_event
4                        |    5
4                        |    6

then for event 4 to start, you must complete event 5 and 6.

Event loops are not supported, and there is no world event that requires that (quite obviously, if it can only happen once in realm lifetime, why would it loop?). If you want reoccuring events, use normal game events.[/b]

What i wanted to do was OpenPvP over quests...for that loops in events are a very good solution, but its not bl!zzlike so i had to modify the code myself

Link to comment
Share on other sites

<div class='quotetop'>QUOTE (Lord X-Press @ Jul 6 2008, 10:30 PM) <{POST_SNAPBACK}></div>

No you can't go back course there is no quest shown...thats like looping and like w12x said not supported, or you reset the state value in the game_event_save[/b]

Exactly. To restart a serverwide event, delete its entries from game_event_save and game_event_condition_save tables.

Link to comment
Share on other sites

<div class='quotetop'>QUOTE (w12x @ Jul 6 2008, 02:01 AM) <{POST_SNAPBACK}></div>

Nope, I didn't find anything that would require that. If there is need for it, that can be part of another patch.[/b]

If I recall correctly, there are some mobs on the new Isle that can tell players what percentage the current phase is at. I think that'll require SD2 support.

~Seline~

Link to comment
Share on other sites

Nope, that is already possible with this patch, using world state fields and gossip options.

Let's take the example of phase 1 in the added test sql.

We add to game_event_npc_gossip an entry to make npc 24965 use gossip id 12240 during phase 1. If you check in the npc_text table, the text with this id has a variable in it, $3244w. This refers to world state field 3244. We also add a game event condition to phase 1 (the percent done value in game_event_condition) and set the done_world_state_field to 3244 (the max_world_state_field is left to 0, since the done is in percent, and max isn't reported, but it is needed in AQ reports).

When a player talks to a reporter npc, the specified world state updates are sent to him, and the client displays the progress properly.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use