This commit is contained in:
MadAgos
2016-08-06 15:02:19 +02:00
14 changed files with 333 additions and 28 deletions
+6 -6
View File
@@ -6,10 +6,10 @@ INSERT INTO `creature_loot_template` (`Entry`, `Item`, `ChanceOrQuestChance`, `L
(26536, 26011, 1, 1, 1, -26011, 1),
(26536, 26012, 1, 1, 1, -26012, 1),
(26536, 26040, 21.4, 1, 0, -26040, 1),
(26536, 33370, 3.6, 0, 1, 1, 1),
(26536, 33399, 3.6, 0, 1, 1, 1),
(26536, 33370, 3.6, 1, 1, 1, 1),
(26536, 33399, 3.6, 1, 1, 1, 1),
(26536, 33454, 35.5, 1, 0, 1, 1),
(26536, 37068, 0.69, 0, 1, 1, 1),
(26536, 37069, 0.69, 0, 1, 1, 1),
(26536, 37070, 0.69, 0, 1, 1, 1),
(26536, 45912, 0.1, 0, 1, 1, 1);
(26536, 37068, 0.69, 1, 1, 1, 1),
(26536, 37069, 0.69, 1, 1, 1, 1),
(26536, 37070, 0.69, 1, 1, 1, 1),
(26536, 45912, 0.1, 1, 1, 1, 1);
@@ -73,6 +73,8 @@ Arena.ArenaStartRating = 1000
Arena.ArenaStartPersonalRating = 1000
Arena.Points.Rate = 1
CharDelete.Method = 1
@@ -0,0 +1,9 @@
DROP TABLE IF EXISTS `azth_character_morph`;
CREATE TABLE `azth_character_morph`(
`guid` INT NOT NULL,
`entry` INT NOT NULL,
`name` TEXT,
`comment` TEXT
);
ALTER TABLE `azth_character_morph`
ADD CONSTRAINT `azth_character_morph` UNIQUE(guid, entry);
@@ -7,6 +7,8 @@
# lvl 3: GM T2
# lvl 4: Administrator
#
# NOTE: use "[^a-z,\,] as regexp to search rows without comma
#
# Move to GM level 4 ( admin ) some dangerous commands
UPDATE command SET `security` = 4 WHERE NAME IN
@@ -40,7 +42,8 @@ UPDATE command SET `security` = 0 WHERE `name` IN
"lookup map",
"lookup skill",
"qc",
"server motd"
"server motd",
""
);
#
@@ -126,6 +129,7 @@ UPDATE command SET `security` = 1 WHERE `name` IN
"titles remove",
"titles add",
"titles current",
"recall",
"tele add",
"tele group",
"tele name",
@@ -136,11 +140,6 @@ UPDATE command SET `security` = 1 WHERE `name` IN
"send mail",
"send items",
"announce",
"ban",
"ban account",
"ban character",
"ban ip",
"ban playeraccount",
"bank",
"freeze",
"unfreeze",
@@ -156,7 +155,7 @@ UPDATE command SET `security` = 1 WHERE `name` IN
"go taxinode",
"go ticket",
"go trigger",
"go zonexy"
"go zonexy",
"gobject activate",
"gobject near",
"gobject target",
@@ -209,6 +208,7 @@ UPDATE command SET `security` = 1 WHERE `name` IN
"ticket unassign",
"ticket viewid",
"ticket viewname",
"ticket complete",
"ticket",
"morph",
"demorph",
@@ -249,8 +249,9 @@ UPDATE command SET `security` = 1 WHERE `name` IN
"gobject move",
"gobject delete",
"gobject add temp",
"gobject add"
"server info"
"gobject add",
"server info",
""
);
# lvl 2: Entertainer
@@ -265,7 +266,8 @@ UPDATE command SET `security` = 2 WHERE `name` IN
"pet create",
"event stop",
"event start",
"playall"
"playall",
""
);
@@ -277,9 +279,10 @@ UPDATE command SET `security` = 3 WHERE `name` IN
"unban character",
"unban account",
"unban",
"ban playeraccount",
"ban ip",
"ban character",
"ban",
"ban account",
"ban"
"ban character",
"ban ip",
"ban playeraccount",
""
);
@@ -1,4 +1,8 @@
UPDATE npc_vendor SET extendedcost = 2440 WHERE item IN (41088,41158,41206,41679,41668,41662,40791,40830,40851,41994,41999,42006,41322,41299,41311,41673,41656,41651,41082,41152,41200,40995,41020,41034,41855,41865,41860,40910,40934,40940,40790,40829,40850,40994,41014,41028,41916,41928,41922,40792,40831,40852,41947,41954,41960,41328,41305,41317);
UPDATE npc_vendor SET extendedcost = 2445 WHERE item IN (41218,41716,40871,42012,41276,41684,41212,41045,41870,40964,40870,41039,41935,40872,41966,41282);
UPDATE npc_vendor SET extendedcost = 2443 WHERE item IN (41144,41774,40811,42018,41288,41768,41138,41008,41875,40928,40810,41002,41941,40812,41972,41294);
UPDATE npc_vendor SET extendedcost = 2444 WHERE item IN (42591,42585,42580,42854,42616,42622,42609,42604,42599);
UPDATE npc_vendor SET extendedcost = 2444 WHERE item IN (42591,42585,42580,42854,42616,42622,42609,42604,42599);
UPDATE npc_vendor SET extendedcost = 2742 WHERE item IN (41088,41158,41206,41679,41668,41662,40791,40830,40851,41994,41999,42006,41322,41299,41311,41673,41656,41651,41082,41152,41200,40995,41020,41034,41855,41865,41860,40910,40934,40940,40790,40829,40850,40994,41014,41028,41916,41928,41922,40792,40831,40852,41947,41954,41960,41328,41305,41317) AND entry IN (37941, 37942, 38858);;
UPDATE npc_vendor SET extendedcost = 2740 WHERE item IN (41218,41716,40871,42012,41276,41684,41212,41045,41870,40964,40870,41039,41935,40872,41966,41282) AND entry IN (37941, 37942, 38858);;
UPDATE npc_vendor SET extendedcost = 2740 WHERE item IN (41144,41774,40811,42018,41288,41768,41138,41008,41875,40928,40810,41002,41941,40812,41972,41294) AND entry IN (37941, 37942, 38858);;
@@ -0,0 +1,22 @@
UPDATE `item_template` SET `Flags` = 64, `ScriptName` = 'azth_main_morph', stackable = 1, `spellid_1` = 36177, maxcount = 5 WHERE (entry = 32561);
DROP TABLE IF EXISTS `azth_morph_template`;
CREATE TABLE `azth_morph_template`(
`entry` INT NOT NULL UNIQUE,
`flags` INT DEFAULT 0,
`default_name` TEXT,
`scale` FLOAT DEFAULT 1,
`aura` INT DEFAULT -1,
`comment` TEXT
);
-- some morph
DELETE FROM `azth_morph_template` WHERE entry = 1060;
INSERT INTO `azth_morph_template` VALUES (1060, 0, "MUCCA!", 3, 17, "prova muccaaa");
UPDATE `item_template` SET `Flags` = 64, `ScriptName` = 'azth_get_morph', `spellid_1` = 36177, stackable = 1060, NAME = "Mucca" WHERE (entry = 32543);
DELETE FROM `azth_morph_template` WHERE entry = 30721;
INSERT INTO `azth_morph_template` VALUES (30721, 0, "The Lich King", 3, 17, "Lich King Morph");
UPDATE `item_template` SET `Flags` = 64, `ScriptName` = 'azth_get_morph', `spellid_1` = 36177, stackable = 30721, NAME = "The Lich King" WHERE (entry = 32544);
@@ -0,0 +1,3 @@
UPDATE npc_vendor SET extendedcost = 2742 WHERE item IN (41088,41158,41206,41679,41668,41662,40791,40830,40851,41994,41999,42006,41322,41299,41311,41673,41656,41651,41082,41152,41200,40995,41020,41034,41855,41865,41860,40910,40934,40940,40790,40829,40850,40994,41014,41028,41916,41928,41922,40792,40831,40852,41947,41954,41960,41328,41305,41317) AND entry IN (37941, 37942, 38858);;
UPDATE npc_vendor SET extendedcost = 2740 WHERE item IN (41218,41716,40871,42012,41276,41684,41212,41045,41870,40964,40870,41039,41935,40872,41966,41282) AND entry IN (37941, 37942, 38858);;
UPDATE npc_vendor SET extendedcost = 2740 WHERE item IN (41144,41774,40811,42018,41288,41768,41138,41008,41875,40928,40810,41002,41941,40812,41972,41294) AND entry IN (37941, 37942, 38858);;
@@ -20,11 +20,7 @@ void CrossFaction::UpdatePlayerTeam(Group* group, uint64 guid, bool reset /* = f
if (isMapEnabled(player->GetMapId()) && isZoneEnabled(player->GetZoneId()) && isAreaEnabled(player->GetAreaId()))
disable = false;
else
{
// message player when crossfaction disabled in a specific area
player->Whisper("Quest'area ha il crossfaction disabilitato", LANG_UNIVERSAL, player->GetGUID());
sLog->outDebug(LOG_FILTER_CROSSFACTION, "Crossfaction: disabled for player %s", player->GetName().c_str());
}
// if not reset or disable, check and change
if (!reset && !disable)
@@ -8,6 +8,9 @@
#include "WorldPacket.h"
#include "Chat.h"
#include "Spell.h"
#include "Define.h"
#include "GossipDef.h"
#include "Item.h"
#define GOSSIP_ITEM_GIVE_PVE_QUEST "Vorrei ricevere la mia missione PVE giornaliera."
@@ -336,10 +339,174 @@ class item_azth_hearthstone_loot_sack : public ItemScript
}
};
class azth_main_morph : public ItemScript
{
public:
azth_main_morph() : ItemScript("azth_main_morph") { }
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) override // Any hook here
{
player->PlayerTalkClass->ClearMenus();
std::string part1 = "SELECT entry, name FROM azth_character_morph WHERE guid = ";
std::string part2 = " LIMIT 0, 200000; ";
std::string temp = part1 + std::to_string(player->GetGUID()) + part2;
const char *query = temp.c_str();
QueryResult result = CharacterDatabase.Query(query);
if (result.null())
return false;
do
{
Field* fields = result->Fetch();
uint32 entry = fields[0].GetUInt32();
std::string name = fields[1].GetString();
if (name == "" || name.empty())
{
std::string part1 = "SELECT default_name FROM azth_morph_template WHERE entry = ";
std::string part2 = " LIMIT 0, 200000; ";
std::string temp = part1 + std::to_string(entry) + part2;
const char *query = temp.c_str();
QueryResult result = WorldDatabase.Query(query);
Field* fields = result->Fetch();
name = fields[0].GetString();
}
player->ADD_GOSSIP_ITEM(0, name, GOSSIP_SENDER_MAIN, entry);
} while (result->NextRow());
player->ADD_GOSSIP_ITEM(0, "Demorph", GOSSIP_SENDER_MAIN, 1);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, item->GetGUID());
return false; // Cast the spell on use normally
}
void OnGossipSelect(Player* player, Item* /*item*/, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
uint32 entry;
if (action == 1)
entry = player->GetDisplayId();
else
entry = action;
std::string part1 = "SELECT flags, scale, aura FROM azth_morph_template WHERE entry = ";
std::string part2 = " LIMIT 0, 1; ";
std::string temp = part1 + std::to_string(entry) + part2;
const char *query = temp.c_str();
QueryResult result = WorldDatabase.Query(query);
if (result.null())
{
player->CLOSE_GOSSIP_MENU();
return;
}
Field* fields = result->Fetch();
uint32 flags = fields[0].GetUInt32();
float scale = fields[1].GetFloat();
uint32 aura = 0;
if (fields[2].GetInt32() != -1)
aura = fields[2].GetUInt32();
switch (action)
{
case 1:
player->DeMorph();
player->SetObjectScale(1);
if (aura > 0)
player->RemoveAura(aura, AURA_REMOVE_BY_DEFAULT);
break;
default:
player->SetDisplayId(action);
player->SetObjectScale(scale);
if (aura > 0)
player->AddAura(aura, player);
//if (flags > 0)
// do something
break;
}
player->CLOSE_GOSSIP_MENU();
}
};
class azth_get_morph : public ItemScript
{
public:
azth_get_morph() : ItemScript("azth_get_morph") { }
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/) override // Any hook here
{
player->PlayerTalkClass->ClearMenus();
player->ADD_GOSSIP_ITEM(0, "Aggiungi senza soprannome.", GOSSIP_SENDER_MAIN, 1);
player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_CHAT, "Aggiungi con soprannome.", GOSSIP_SENDER_MAIN, 2, "Scrivi un soprannome per questa skin.", 0, true);
player->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, item->GetGUID());
return false;
}
void OnGossipSelect(Player* player, Item* item, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
if (action != 1)
return;
std::string part1 = "REPLACE INTO azth_character_morph (guid, entry) VALUES (";
std::string part2 = ");";
std::string part3 = ",";
std::string temp = part1 + std::to_string(player->GetGUID()) + part3 + std::to_string(item->GetMaxStackCount()) + part2;
const char *query = temp.c_str();
QueryResult result = CharacterDatabase.Query(query);
player->CLOSE_GOSSIP_MENU();
}
void OnGossipSelectCode(Player* player, Item* item, uint32 /*sender*/, uint32 action, const char* code) override
{
player->PlayerTalkClass->ClearMenus();
if (code == "" || *code == 0)
{
ChatHandler(player->GetSession()).SendSysMessage("Verrà salvata la skin senza soprannome!");
}
if (action != 2)
return;
std::string part1 = "REPLACE INTO azth_character_morph (guid, entry, name) VALUES (";
std::string part2 = ");";
std::string part3 = ",";
std::string apici = "\"";
std::string temp = part1 + std::to_string(player->GetGUID()) + part3 + std::to_string(item->GetMaxStackCount()) + part3 + apici + code + apici + part2;
const char *query = temp.c_str();
QueryResult result = CharacterDatabase.Query(query);
player->CLOSE_GOSSIP_MENU();
}
};
void AddSC_hearthstone()
{
new npc_han_al();
new npc_azth_vendor();
new item_azth_hearthstone_loot_sack();
new azth_main_morph();
new azth_get_morph();
}
+36 -2
View File
@@ -101,6 +101,7 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
Creature* unit = NULL;
GameObject* go = NULL;
Item* item = NULL;
if (IS_CRE_OR_VEH_GUID(guid))
{
unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_NONE);
@@ -119,6 +120,23 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
return;
}
}
else if (IS_ITEM_GUID(guid))
{
item = _player->GetItemByGuid(guid);
if (!item || _player->IsBankPos(item->GetPos()))
{
//TC_LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - %s not found.", guid.ToString().c_str());
return;
}
}
else if (IS_PLAYER_GUID(guid))
{
if (guid != _player->GetGUID() || menuId != _player->PlayerTalkClass->GetGossipMenu().GetMenuId())
{
//TC_LOG_DEBUG("network", "WORLD: HandleGossipSelectOptionOpcode - %s not found.", guid.ToString().c_str());
return;
}
}
else
{
;//sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: HandleGossipSelectOptionOpcode - unsupported GUID type for highguid %u. lowpart %u.", uint32(GUID_HIPART(guid)), uint32(GUID_LOPART(guid)));
@@ -147,11 +165,19 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
if (!sScriptMgr->OnGossipSelectCode(_player, unit, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str()))
_player->OnGossipSelect(unit, gossipListId, menuId);
}
else
else if (go)
{
go->AI()->GossipSelectCode(_player, menuId, gossipListId, code.c_str());
sScriptMgr->OnGossipSelectCode(_player, go, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str());
}
else if (item)
{
sScriptMgr->OnGossipSelectCode(_player, item, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str());
}
else
{
sScriptMgr->OnGossipSelectCode(_player, menuId, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId), code.c_str());
}
}
else
{
@@ -161,12 +187,20 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
if (!sScriptMgr->OnGossipSelect(_player, unit, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId)))
_player->OnGossipSelect(unit, gossipListId, menuId);
}
else
else if (go)
{
go->AI()->GossipSelect(_player, menuId, gossipListId);
if (!sScriptMgr->OnGossipSelect(_player, go, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId)))
_player->OnGossipSelect(go, gossipListId, menuId);
}
else if (item)
{
sScriptMgr->OnGossipSelect(_player, item, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId));
}
else
{
sScriptMgr->OnGossipSelect(_player, menuId, _player->PlayerTalkClass->GetGossipOptionSender(gossipListId), _player->PlayerTalkClass->GetGossipOptionAction(gossipListId));
}
}
}
+28
View File
@@ -703,6 +703,34 @@ bool ScriptMgr::OnItemExpire(Player* player, ItemTemplate const* proto)
return tmpscript->OnExpire(player, proto);
}
void ScriptMgr::OnGossipSelect(Player* player, Item* item, uint32 sender, uint32 action)
{
ASSERT(player);
ASSERT(item);
GET_SCRIPT(ItemScript, item->GetScriptId(), tmpscript);
tmpscript->OnGossipSelect(player, item, sender, action);
}
void ScriptMgr::OnGossipSelectCode(Player* player, Item* item, uint32 sender, uint32 action, const char* code)
{
ASSERT(player);
ASSERT(item);
GET_SCRIPT(ItemScript, item->GetScriptId(), tmpscript);
tmpscript->OnGossipSelectCode(player, item, sender, action, code);
}
void ScriptMgr::OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action)
{
FOREACH_SCRIPT(PlayerScript)->OnGossipSelect(player, menu_id, sender, action);
}
void ScriptMgr::OnGossipSelectCode(Player* player, uint32 menu_id, uint32 sender, uint32 action, const char* code)
{
FOREACH_SCRIPT(PlayerScript)->OnGossipSelectCode(player, menu_id, sender, action, code);
}
bool ScriptMgr::OnGossipHello(Player* player, Creature* creature)
{
ASSERT(player);
+26
View File
@@ -422,6 +422,15 @@ class ItemScript : public ScriptObject
// Called when the item expires (is destroyed).
virtual bool OnExpire(Player* /*player*/, ItemTemplate const* /*proto*/) { return false; }
// <AZTH
// Called when a player selects an option in an item gossip window
virtual void OnGossipSelect(Player* /*player*/, Item* /*item*/, uint32 /*sender*/, uint32 /*action*/) { }
// Called when a player selects an option in an item gossip window
virtual void OnGossipSelectCode(Player* /*player*/, Item* /*item*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) { }
// >AZTH
};
class CreatureScript : public ScriptObject, public UpdatableScript<Creature>
@@ -767,6 +776,15 @@ class PlayerScript : public ScriptObject
virtual void OnAchiSave(SQLTransaction& /*trans*/, Player* /*player*/, uint16 /*achId*/, CompletedAchievementData /*achiData*/) { }
virtual void OnCriteriaSave(SQLTransaction& /*trans*/, Player* /*player*/, uint16 /*achId*/, CriteriaProgress /*criteriaData*/) { }
// Called when a player selects an option in a player gossip window
virtual void OnGossipSelect(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/) { }
// Called when a player selects an option in a player gossip window
virtual void OnGossipSelectCode(Player* /*player*/, uint32 /*menu_id*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/) { }
//[/AZTH]
};
@@ -924,6 +942,12 @@ class ScriptMgr
bool OnItemUse(Player* player, Item* item, SpellCastTargets const& targets);
bool OnItemExpire(Player* player, ItemTemplate const* proto);
// <AZTH
void OnGossipSelect(Player* player, Item* item, uint32 sender, uint32 action);
void OnGossipSelectCode(Player* player, Item* item, uint32 sender, uint32 action, const char* code);
// >AZTH
public: /* CreatureScript */
bool OnGossipHello(Player* player, Creature* creature);
@@ -1044,6 +1068,8 @@ class ScriptMgr
void OnCriteriaProgress(Player *player, AchievementCriteriaEntry const* criteria);
void OnAchievementSave(SQLTransaction& trans, Player* player, uint16 achiId, CompletedAchievementData achiData);
void OnCriteriaSave(SQLTransaction& trans, Player* player, uint16 critId, CriteriaProgress criteriaData);
void OnGossipSelect(Player* player, uint32 menu_id, uint32 sender, uint32 action);
void OnGossipSelectCode(Player* player, uint32 menu_id, uint32 sender, uint32 action, const char* code);
// [/AZTH]
public: /* GuildScript */
+3
View File
@@ -3133,6 +3133,9 @@ void SpellMgr::LoadSpellCustomAttr()
spellInfo->RecoveryTime = 1500;
spellInfo->_requireCooldownInfo = true;
break;
case 44535: // Spirit Heal, abilities also have no cost
spellInfo->Effects[EFFECT_0].MiscValue = 127;
break;
}
switch (spellInfo->SpellFamilyName)
+8
View File
@@ -602,6 +602,14 @@ void World::LoadConfigSettings(bool reload)
sLog->outError("DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]);
rate_values[RATE_DURABILITY_LOSS_BLOCK] = 0.0f;
}
//[AZTH] Arena Points Rate
rate_values[RATE_ARENA_POINTS] = sConfigMgr->GetFloatDefault("Arena.Points.Rate", 1.0f);
if (rate_values[RATE_ARENA_POINTS] < 1.0f)
{
sLog->outError("Arena.Points.Rate (%f) must be >=1. Using 1.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]);
rate_values[RATE_ARENA_POINTS] = 1.0f;
}
//[/AZTH]
///- Read other configuration items from the config file
m_bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfigMgr->GetBoolDefault("DurabilityLoss.InPvP", false);