PDA

Просмотр полной версии : [11985][patch] Го тип 10 и gameobject_scripts


NeatElves
02.10.2011, 14:21
Существуют го (интересны клетки(руда), для квестов по спасению(открытию)) двух типов - тип0 и тип10, если для первых поддержка gameobject_scripts есть в ядре, то для вторых - только event_scripts, патчик предлагает - если нет у го номера в data2 для евентскрипта(можно номер прописать - но будут говорить, мол не по кешу шаблон меняем) - обращаться в госкрипты.)

diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index caf7ce2..941a713 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -1117,6 +1117,9 @@ void GameObject::Use(Unit* user)
if (!sScriptMgr.OnProcessEvent(info->goober.eventId, player, this, true))
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
}
+ else
+ // activate script
+ GetMap()->ScriptsStart(sGameObjectScripts, GetGUIDLow(), spellCaster, this);

// possible quest objective for active quests
if (info->goober.questId && sObjectMgr.GetQuestTemplate(info->goober.questId))

Пример:
http://ru.wowhead.com/quest=12843
гуиды ЮТДБ
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (46557, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (46560, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52610, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52615, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52617, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52622, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52628, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52630, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52637, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52645, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52647, 2, 8, 29466, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (46557, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (46560, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52610, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52615, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52617, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52622, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52628, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52630, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52637, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52645, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
REPLACE INTO `gameobject_scripts` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `comments`) VALUES (52647, 1, 0, 0, 29466, 5, 0, 0, 2000000463, 0, 0, 0, 0, 0, 0, 0, '');
UPDATE `creature_template` SET `npcflag` = '0' WHERE `entry` =29466;
REPLACE INTO `db_script_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES ('2000000463', 'I''m free? I''m free!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

При юзе клетки с ключом - крик спасенного и киллкредит, клетка имеет автозакрытие

schmoozerd
19.11.2011, 23:35
infact it might be an idea to allow db-scripts for _every_ type of GO
(if it is used in a bad way, then problem of the user)

at least this could be discussed.

I really don't like that the current gameobject_scripts system is based on gameobject guid, and not entry.
Probably it would be wise to change this asap (if possible)

schmoozerd
04.05.2012, 21:41
Alternate version in [11985]
(support for go-scripts by entry)

Forward information: on UDB the scripts in go_scripts can be entirely moved to go_template_scripts.