This commit is contained in:
TheLuda 2008-10-14 00:29:20 +02:00
parent d767495d5b
commit 800ee76535
3322 changed files with 903437 additions and 0 deletions

View file

@ -0,0 +1,119 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* 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
*/
#include "sc_defines.h"
bool GossipHello_default(Player* /*player*/, Creature* /*_Creature*/)
{
return false;
}
bool GossipSelect_default(Player* /*player*/, Creature* /*_Creature*/, uint32 /*sender*/, uint32 /*action*/ )
{
return false;
}
bool GossipSelectWithCode_default( Player* /*player*/, Creature* /*_Creature*/, uint32 /*sender*/, uint32 /*action*/, const char* /*sCode*/ )
{
return false;
}
bool QuestAccept_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/ )
{
return false;
}
bool QuestSelect_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/ )
{
return false;
}
bool QuestComplete_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/ )
{
return false;
}
bool ChooseReward_default(Player* /*player*/, Creature* /*_Creature*/, Quest const* /*_Quest*/, uint32 /*opt*/ )
{
return false;
}
uint32 NPCDialogStatus_default(Player* /*player*/, Creature* /*_Creature*/ )
{
return 128;
}
uint32 GODialogStatus_default(Player* /*player*/, GameObject* /*_Creature*/ )
{
return 128;
}
bool ItemHello_default(Player* /*player*/, Item* /*_Item*/, Quest const* /*_Quest*/ )
{
return false;
}
bool ItemQuestAccept_default(Player* /*player*/, Item* /*_Item*/, Quest const* /*_Quest*/ )
{
return false;
}
bool GOHello_default(Player* /*player*/, GameObject* /*_GO*/ )
{
return false;
}
bool GOQuestAccept_default(Player* /*player*/, GameObject* /*_GO*/, Quest const* /*_Quest*/ )
{
return false;
}
bool GOChooseReward_default(Player* /*player*/, GameObject* /*_GO*/, Quest const* /*_Quest*/, uint32 /*opt*/ )
{
return false;
}
bool AreaTrigger_default(Player* /*player*/, AreaTriggerEntry* /*atEntry*/ )
{
return false;
}
void AddSC_default()
{
Script *newscript;
newscript = new Script;
newscript->Name="default";
newscript->pGossipHello = &GossipHello_default;
newscript->pQuestAccept = &QuestAccept_default;
newscript->pGossipSelect = &GossipSelect_default;
newscript->pGossipSelectWithCode = &GossipSelectWithCode_default;
newscript->pQuestSelect = &QuestSelect_default;
newscript->pQuestComplete = &QuestComplete_default;
newscript->pNPCDialogStatus = &NPCDialogStatus_default;
newscript->pGODialogStatus = &GODialogStatus_default;
newscript->pChooseReward = &ChooseReward_default;
newscript->pItemHello = &ItemHello_default;
newscript->pGOHello = &GOHello_default;
newscript->pAreaTrigger = &AreaTrigger_default;
newscript->pItemQuestAccept = &ItemQuestAccept_default;
newscript->pGOQuestAccept = &GOQuestAccept_default;
newscript->pGOChooseReward = &GOChooseReward_default;
m_scripts[nrscripts++] = newscript;
}

View file

@ -0,0 +1,152 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* 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
*/
#include "sc_defines.h"
#include "../../game/Player.h"
uint32 GetSkillLevel(Player *player,uint32 trskill)
{
// Returns the level of some tradetrskill known by player
// Need to add missing spells
uint32 spell_apprentice = 0;
uint32 spell_journeyman = 0;
uint32 spell_expert = 0;
uint32 spell_artisan = 0;
uint32 spell_master = 0;
switch(trskill)
{
case TRADESKILL_ALCHEMY:
spell_apprentice = 2259;
spell_journeyman = 3101;
spell_expert = 3464;
spell_artisan = 11611;
spell_master = 28596; // teached by 28597
break;
case TRADESKILL_BLACKSMITHING:
spell_apprentice = 2018;
spell_journeyman = 3100;
spell_expert = 8768;
spell_artisan = 11454;
spell_master = 29844; // teached by 29845
break;
case TRADESKILL_COOKING:
spell_apprentice = 2550;
spell_journeyman = 3102;
spell_expert = 3413;
spell_artisan = 18260;
spell_master = 33359; // teached by 33361
break;
case TRADESKILL_ENCHANTING:
spell_apprentice = 7411;
spell_journeyman = 7412;
spell_expert = 7413;
spell_artisan = 13920;
spell_master = 28029; // teached by 28030
break;
case TRADESKILL_ENGINEERING:
spell_apprentice = 4036;
spell_journeyman = 4037;
spell_expert = 4038;
spell_artisan = 12656;
spell_master = 30350; // teached by 30351
break;
case TRADESKILL_FIRSTAID:
spell_apprentice = 3273;
spell_journeyman = 3274;
spell_expert = 7924;
spell_artisan = 10846;
spell_master = 27028; // teached by 27029
break;
case TRADESKILL_HERBALISM:
spell_apprentice = 2372;
spell_journeyman = 2373;
spell_expert = 3571;
spell_artisan = 11994;
spell_master = 0;
break;
case TRADESKILL_LEATHERWORKING:
spell_apprentice = 2108;
spell_journeyman = 3104;
spell_expert = 20649;
spell_artisan = 10662;
spell_master = 32549; // teached by 32550
break;
case TRADESKILL_POISONS:
spell_apprentice = 0;
spell_journeyman = 0;
spell_expert = 0;
spell_artisan = 0;
spell_master = 0;
break;
case TRADESKILL_TAILORING:
spell_apprentice = 3908;
spell_journeyman = 3909;
spell_expert = 3910;
spell_artisan = 12180;
spell_master = 26790; // teached by 26791
break;
case TRADESKILL_MINING:
spell_apprentice = 2581;
spell_journeyman = 2582;
spell_expert = 3568;
spell_artisan = 10249;
spell_master = 29354; // teached by 29355
break;
case TRADESKILL_FISHING:
spell_apprentice = 7733;
spell_journeyman = 7734;
spell_expert = 7736;
spell_artisan = 18249;
spell_master = 33098; // teached by 33100
break;
case TRADESKILL_SKINNING:
spell_apprentice = 8615;
spell_journeyman = 8619;
spell_expert = 8620;
spell_artisan = 10769;
spell_master = 32679; // teached by 32678
break;
case TRADESKILL_JEWELCRAFTING:
spell_apprentice = 25229; // teached by 25245
spell_journeyman = 25230; // teached by 25246
spell_expert = 28894; // teached by 28896
spell_artisan = 28895; // teached by 28899
spell_master = 28897; // teached by 28901
break;
}
if (player->HasSpell(spell_master))
return TRADESKILL_LEVEL_MASTER;
if (player->HasSpell(spell_artisan))
return TRADESKILL_LEVEL_ARTISAN;
if (player->HasSpell(spell_expert))
return TRADESKILL_LEVEL_EXPERT;
if (player->HasSpell(spell_journeyman))
return TRADESKILL_LEVEL_JOURNEYMAN;
if (player->HasSpell(spell_apprentice))
return TRADESKILL_LEVEL_APPRENTICE;
return TRADESKILL_LEVEL_NONE;
}

View file

@ -0,0 +1,96 @@
/*
* Copyright (C) 2005-2008 MaNGOS <http://getmangos.com/>
*
* 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
*/
#ifndef SC_DEFINES_H
#define SC_DEFINES_H
#include "../ScriptMgr.h"
// Skill defines
#define TRADESKILL_ALCHEMY 1
#define TRADESKILL_BLACKSMITHING 2
#define TRADESKILL_COOKING 3
#define TRADESKILL_ENCHANTING 4
#define TRADESKILL_ENGINEERING 5
#define TRADESKILL_FIRSTAID 6
#define TRADESKILL_HERBALISM 7
#define TRADESKILL_LEATHERWORKING 8
#define TRADESKILL_POISONS 9
#define TRADESKILL_TAILORING 10
#define TRADESKILL_MINING 11
#define TRADESKILL_FISHING 12
#define TRADESKILL_SKINNING 13
#define TRADESKILL_JEWELCRAFTING 14
#define TRADESKILL_LEVEL_NONE 0
#define TRADESKILL_LEVEL_APPRENTICE 1
#define TRADESKILL_LEVEL_JOURNEYMAN 2
#define TRADESKILL_LEVEL_EXPERT 3
#define TRADESKILL_LEVEL_ARTISAN 4
#define TRADESKILL_LEVEL_MASTER 5
// Gossip defines
#define GOSSIP_ACTION_TRADE 1
#define GOSSIP_ACTION_TRAIN 2
#define GOSSIP_ACTION_TAXI 3
#define GOSSIP_ACTION_GUILD 4
#define GOSSIP_ACTION_BATTLE 5
#define GOSSIP_ACTION_BANK 6
#define GOSSIP_ACTION_INN 7
#define GOSSIP_ACTION_HEAL 8
#define GOSSIP_ACTION_TABARD 9
#define GOSSIP_ACTION_AUCTION 10
#define GOSSIP_ACTION_INN_INFO 11
#define GOSSIP_ACTION_UNLEARN 12
#define GOSSIP_ACTION_INFO_DEF 1000
#define GOSSIP_SENDER_MAIN 1
#define GOSSIP_SENDER_INN_INFO 2
#define GOSSIP_SENDER_INFO 3
#define GOSSIP_SENDER_SEC_PROFTRAIN 4
#define GOSSIP_SENDER_SEC_CLASSTRAIN 5
#define GOSSIP_SENDER_SEC_BATTLEINFO 6
#define DEFAULT_GOSSIP_MESSAGE 0xffffff
extern uint32 GetSkillLevel(Player *player,uint32 skill);
// Defined functions to use with player.
#define ADD_GOSSIP_ITEM(a,b,c,d,e,f) PlayerTalkClass->GetGossipMenu()->AddMenuItem(a,b,c,d,e,f)
#define SEND_GOSSIP_MENU(a,b) PlayerTalkClass->SendGossipMenu(a,b)
#define SEND_POI(a,b,c,d,e,f) PlayerTalkClass->SendPointOfInterest(a,b,c,d,e,f)
#define CLOSE_GOSSIP_MENU() PlayerTalkClass->CloseGossip();
#define QUEST_DIALOG_STATUS(a,b,c) GetSession()->getDialogStatus(a,b,c)
#define SEND_QUEST_DETAILS(a,b,c) PlayerTalkClass->SendQuestDetails(a,b,c)
#define SEND_REQUESTEDITEMS(a,b,c,d) PlayerTalkClass->SendRequestedItems(a,b,c,d)
#define SEND_VENDORLIST(a) GetSession()->SendListInventory(a)
#define SEND_TRAINERLIST(a) GetSession()->SendTrainerList(a)
#define SEND_BANKERLIST(a) GetSession()->SendShowBank(a)
#define SEND_TABARDLIST(a) GetSession()->SendTabardVendorActivate(a)
#define SEND_AUCTIONLIST(a) GetSession()->SendAuctionHello(a)
#define SEND_TAXILIST(a) GetSession()->SendTaxiStatus(a)
#define SEND_SPRESURRECT() GetSession()->SendSpiritResurrect()
#define GET_HONORRANK() GetHonorRank()
// -----------------------------------
#endif