• Страница 1 из 1
  • 1
Архив - только для чтения
Модератор форума: andycrowz  
Исправление квеста ДК
csstalkers
Скаут
Salanar The Horseman

--------------------------------------------------------------------------------

There were several things missing:
1. #include "precompiled.h"<-- it does contains classes like Player, Creature and Unit you need it in each script.
2. According to coding standarts of SD2 I dont know why each devisee have to have an p on begining so -> pCreature, pPlayer and pUnit.
3. DoCast was not fitting its also should be shown while compiling the script, so pPlayer->CastSpell(pPlayer, SPELL_RETURN_REALM, false);
4. Dont forget to close GOSSIP so: pPlayer->CLOSE_GOSSIP_MENU();
Hope that it does help you good luck
Full working script based on yours:

/* Copyright © 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

/* ScriptData
SDName: Salaran Horseman
SD%Complete: 0
SDComment:
SDCategory: Salaran Horseman
EndScriptData */
#include "precompiled.h"

#define GOSSIP_RETURN_REALM "I must return to the Realm of Shadows."
#define SPELL_RETURN_REALM 52693

bool GossipHello_npc_salanar_horseman(Player* pPlayer, Creature* pCreature)
{
if (pCreature->isQuestGiver())
pPlayer->PrepareQuestMenu(pCreature->GetGUID());

if (pPlayer->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE)
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_RETURN_REALM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
pPlayer->SEND_GOSSIP_MENU(9978,pCreature->GetGUID());
return true;
}

bool GossipSelect_npc_salanar_horseman(Player *pPlayer, Creature *pCreature, uint32 sender, uint32 action )
{
if (action == GOSSIP_ACTION_INFO_DEF + 1)
{
pPlayer->CLOSE_GOSSIP_MENU();
pPlayer->CastSpell(pPlayer, SPELL_RETURN_REALM, false);
}
return true;
}

void AddSC_npc_salanar_horseman()
{
Script *newscript;

newscript = new Script;
newscript->Name = "npc_salanar_horseman";
newscript->pGossipHello = &GossipHello_npc_salanar_horseman;
newscript->pGossipSelect = &GossipSelect_npc_salanar_horseman;
newscript->RegisterSelf();
}

Это исправление для ScriptDev2, только вот как и куда его вставлять, знает ктонибудь? И если можно выложите его в форме патча.

Сообщение # 1 отредактировано csstalkers - Среда, 06.01.2010, 19:41
ZetGet
Рыцарь
это скрипт для SD2 - ставится как и все скрипты для SD2...
это устанавливается без патча, т.к. установка рабочего скрипта в SD2 не занимает более 5 минут.

Мой мини-мануальчик переделанный под эту ситуацию

Code
1. Создаем файл [b]npc_salanar_horseman.cpp[/b] в директории \src\bindings\scriptdev2\scripts\custom (корневая директория = директория с исходниками MaNGOS)
2. Вставляем содержимое скрипта (ниже в блоке, то что вставлять нужно)
3. Смотрим в самом низу блок [b]void AddSC_npc_salanar_horseman()[/b] - нам нужно название после void (это название не постоянно и различно в разных скриптах)
4. Копируем название в буфер обмена - AddSC_npc_salanar_horseman()
5. Заходим в \src\bindings\scriptdev2\system\ScriptLoader.cpp
6. После [b]//custom[/b] вставляем ниже похожею строку с нашим названием (оно у нас в буфере) - [b]extern void AddSC_npc_salanar_horseman();[/b]
7. В этом же файле ниже ищем [b]//custom[/b] и там вставляем ниже наше название скрипта - [b]AddSC_npc_salanar_horseman();[/b]
8. Сохраняем файл
9. Заходим в \src\bindings\scriptdev2\VC90(всё зависит от того чем мы компилируем нашу программу)\90ScriptDev2.vcproj и нам нужно добавить после: [b]<Filter Name="custom" >[/b], строку: <File RelativePath="..\scripts\custom\npc_arena_honor.cpp" ></File>
10. Сохраняем и компилируем наш ScriptDev2...  

Code
/* Copyright © 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>  
* This program is free software; you can redistribute it and/or modify  
* it under the terms of the GNU General Public License as published by  
* the Free Software Foundation; either version 2 of the License, or  
* (at your option) any later version.  
*  
* This program is distributed in the hope that it will be useful,  
* but WITHOUT ANY WARRANTY; without even the implied warranty of  
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
* GNU General Public License for more details.  
*  
* You should have received a copy of the GNU General Public License  
* along with this program; if not, write to the Free Software  
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA  
*/  

/* ScriptData  
SDName: Salaran Horseman  
SD%Complete: 0  
SDComment:  
SDCategory: Salaran Horseman  
EndScriptData */  
#include "precompiled.h"  

#define GOSSIP_RETURN_REALM "I must return to the Realm of Shadows."  
#define SPELL_RETURN_REALM 52693  

bool GossipHello_npc_salanar_horseman(Player* pPlayer, Creature* pCreature)  
{  
if (pCreature->isQuestGiver())  
pPlayer->PrepareQuestMenu(pCreature->GetGUID());  

if (pPlayer->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE)  
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_RETURN_REALM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);  
pPlayer->SEND_GOSSIP_MENU(9978,pCreature->GetGUID());  
return true;  
}  

bool GossipSelect_npc_salanar_horseman(Player *pPlayer, Creature *pCreature, uint32 sender, uint32 action )  
{  
if (action == GOSSIP_ACTION_INFO_DEF + 1)  
{  
pPlayer->CLOSE_GOSSIP_MENU();  
pPlayer->CastSpell(pPlayer, SPELL_RETURN_REALM, false);  
}  
return true;  
}  

void AddSC_npc_salanar_horseman()  
{  
Script *newscript;  

newscript = new Script;  
newscript->Name = "npc_salanar_horseman";  
newscript->pGossipHello = &GossipHello_npc_salanar_horseman;  
newscript->pGossipSelect = &GossipSelect_npc_salanar_horseman;  
newscript->RegisterSelf();  
}
Сообщение # 2 написано 07.01.2010 в 10:35
csstalkers
Скаут
Спасибище!
Сообщение # 3 написано 07.01.2010 в 11:32
Dlink_lip
Чемпион
Все работает отлично?
Сообщение # 4 написано 07.01.2010 в 11:34
csstalkers
Скаут
Я ещё непроверил, но этот патч должен исправить работу квеста the Realm of Shadows.

Добавлено (07.01.2010, 12:22)
---------------------------------------------
Что то неполучается. Вот что выдаёт в конце:

Creating library ..\..\..\..\bin\win32_release/MaNGOSScript.lib and object ..\..\..\..\bin\win32_release/MaNGOSScript.exp
ScriptLoader.obj : error LNK2019: unresolved external symbol "void __cdecl AddSC_npc_salanar_horseman(void)" (?AddSC_npc_salanar_horseman@@YAXXZ) referenced in function "void __cdecl AddScripts(void)" (?AddScripts@@YAXXZ)
..\..\..\..\bin\win32_release/MaNGOSScript.dll : fatal error LNK1120: 1 unresolved externals
Build log was saved at "file://c:\1\Mangos\src\bindings\ScriptDev2\VC90\ScriptDev2__Win32_Release\BuildLog.htm"
ScriptDev2 - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Добавлено (07.01.2010, 12:40)
---------------------------------------------
Ой забыл 9 пункт добавить всё получилось!
Походу этот патч квест не исправил, как нерабил, так и нерабит.

Сообщение # 5 отредактировано csstalkers - Четверг, 07.01.2010, 13:46
ZetGet
Рыцарь
уважаемый, а кто NPC будет заменять ScriptName (в данном скрипте название самого скрипта для базы- npc_salanar_horseman ) в базе?!

Добавлено (07.01.2010, 18:11)
---------------------------------------------
забыл шаблон sql вставить...

Code
UPDATE creature_template SET ScriptName='ИМЯСКРИПТА' WHERE entry=АЙДИНПЦ;
Сообщение # 6 написано 07.01.2010 в 18:11
ph3n
Developer
Данная тема была перемещена из раздела Патчи в ядро MaNGOS.
Причина перемещения: Устарело

Переместил: ph3n.
Сообщение # 7 написано 11.10.2012 в 14:44
  • Страница 1 из 1
  • 1
Поиск: