Compare commits
28 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f06300031e | |||
| 442c708e85 | |||
| 451d783994 | |||
| 1df95daa5a | |||
| f9cb8e6e44 | |||
| a0ec2976ef | |||
| 991afe708a | |||
| 72cede7878 | |||
| deff67efeb | |||
| 7c4b2c77bb | |||
| f04afd14d8 | |||
| 73c4349fa9 | |||
| 86cb8811b1 | |||
| 0c72d04d38 | |||
| 2f1278cb7c | |||
| f8177f5ac4 | |||
| 98858d29b5 | |||
| 334d127e6a | |||
| bca073ef4a | |||
| 423e140f46 | |||
| 2bf075d616 | |||
| b920ec50ab | |||
| e965678adf | |||
| 5918cf7b1a | |||
| e04f0f068c | |||
| 85287568b5 | |||
| 9d7bfe2516 | |||
| b5f3f51208 |
@@ -341,6 +341,14 @@ import_encounter_journal_sql() {
|
||||
fi
|
||||
}
|
||||
|
||||
import_premium_sql() {
|
||||
log "Started importing Premium SQL files"
|
||||
|
||||
local world_premium_sql="$ROOT_DIR/sql/Premium/world.sql"
|
||||
|
||||
import_sql_file "acore_world" "$world_premium_sql"
|
||||
}
|
||||
|
||||
if (($# > 0)); then
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
@@ -373,6 +381,7 @@ import_playerbots_ru_sql
|
||||
import_encounter_journal_sql
|
||||
import_store_sql
|
||||
import_transmog_sql
|
||||
import_premium_sql
|
||||
configure_server_motd
|
||||
|
||||
log "custom SQL bootstrap completed"
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
return {}
|
||||
@@ -0,0 +1,204 @@
|
||||
local PLAYER_EVENT_ON_LOGIN = 3
|
||||
local PLAYER_EVENT_ON_SPELL_CAST = 5
|
||||
local PLAYER_EVENT_ON_LOGOUT = 4
|
||||
local PLAYER_EVENT_ON_COMMAND = 42
|
||||
local PLAYER_EVENT_ON_BEFORE_TELEPORT = 67
|
||||
|
||||
|
||||
local ACCOUNT_FLAG_RECURRING_BILLING = 8192
|
||||
|
||||
local SUMMON_SQUIRE_SPELL_ID = 80000
|
||||
local HEARTHSTONE_SPELL_ID = 8690
|
||||
|
||||
local SQUIRE_CREATURE_TEMPLATE_ID = 9000001
|
||||
|
||||
local ALLIANCE_AUCTIONEER_CREATURE_TEMPLATE_ID = 15659
|
||||
local HORDE_AUCTIONEER_CREATURE_TEMPLATE_ID = 8673
|
||||
|
||||
local NPC_TEXT_ID = 10000000
|
||||
|
||||
local premiums_table = {}
|
||||
local squires_table = {}
|
||||
|
||||
---todo extract to utils
|
||||
---@param inputstr string
|
||||
---@param separator string
|
||||
---@return table
|
||||
local function SplitString(inputstr, separator)
|
||||
if separator == nil then
|
||||
separator = "%s"
|
||||
end
|
||||
local t = {}
|
||||
for str in string.gmatch(inputstr, "([^" .. separator .. "]+)") do
|
||||
table.insert(t, str)
|
||||
end
|
||||
return t
|
||||
end
|
||||
|
||||
---@return boolean
|
||||
local function IsPremium(player)
|
||||
return premiums_table[player:GetAccountId()] == true
|
||||
end
|
||||
|
||||
local function OnPremiumPlayer(player)
|
||||
player:SendAreaTriggerMessage(
|
||||
'На вашем аккаунте активна подписка Premium! Благодарим за поддержку проекта MoonWell.')
|
||||
|
||||
player:LearnSpell(SUMMON_SQUIRE_SPELL_ID)
|
||||
player:SendBroadcastMessage("Милостью Элуны вам была выдана способность |cff71d5ff|Hspell:" ..
|
||||
SUMMON_SQUIRE_SPELL_ID .. "|h[" .. "Призыв Оруженосца]h|")
|
||||
|
||||
player:ResetSpellCooldown(HEARTHSTONE_SPELL_ID)
|
||||
end
|
||||
|
||||
local function RefreshPremiumStatus(player)
|
||||
local query = AuthDBQuery("SELECT flags FROM account WHERE id = " .. player:GetAccountId())
|
||||
|
||||
if query then
|
||||
local function HasFlag(mask, flag)
|
||||
return bit_and(mask, flag) == flag
|
||||
end
|
||||
|
||||
|
||||
local flags = query:GetUInt32(0)
|
||||
|
||||
if HasFlag(flags, ACCOUNT_FLAG_RECURRING_BILLING) then
|
||||
premiums_table[player:GetAccountId()] = true
|
||||
|
||||
OnPremiumPlayer(player)
|
||||
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
local function ApplyPremium(player)
|
||||
AuthDBExecute(
|
||||
string.format(
|
||||
"UPDATE account SET flags = flags | %d WHERE id = %d",
|
||||
ACCOUNT_FLAG_RECURRING_BILLING,
|
||||
player:GetAccountId()
|
||||
)
|
||||
)
|
||||
|
||||
RefreshPremiumStatus(player)
|
||||
end
|
||||
|
||||
local function OnLogin(event, player)
|
||||
RefreshPremiumStatus(player)
|
||||
end
|
||||
|
||||
--- @param event any
|
||||
--- @param player any
|
||||
--- @param command string
|
||||
--- @param chatHandler any
|
||||
local function OnCommand(event, player, command, chatHandler)
|
||||
---Console is not supported yet
|
||||
if not player then return end
|
||||
|
||||
local parts = SplitString(command:lower(), ' ')
|
||||
|
||||
if parts[1] ~= 'premium' then return end
|
||||
|
||||
if parts[2] == 'add' then
|
||||
ApplyPremium(player:GetSelection())
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
local function OnSummonSquireCast(player)
|
||||
local x, y, z, o = player:GetLocation()
|
||||
|
||||
if (squires_table[player:GetGUIDLow()] ~= nil) then
|
||||
local existing_squire = player:GetMap():GetWorldObject(squires_table[player:GetGUIDLow()])
|
||||
if (existing_squire ~= nil) then
|
||||
existing_squire:DespawnOrUnsummon()
|
||||
end
|
||||
end
|
||||
|
||||
local squire = player:SpawnCreature(SQUIRE_CREATURE_TEMPLATE_ID, x + 1, y + 1, z, o, 1, 30000)
|
||||
squires_table[player:GetGUIDLow()] = squire:GetGUID()
|
||||
|
||||
if squire then
|
||||
squire:SetFaction(player:GetFaction())
|
||||
end
|
||||
end
|
||||
|
||||
local function OnSpellCast(event, player, spell, skipCheck)
|
||||
local spellId = spell:GetEntry()
|
||||
|
||||
if spellId == SUMMON_SQUIRE_SPELL_ID then
|
||||
OnSummonSquireCast(player)
|
||||
end
|
||||
end
|
||||
|
||||
local function OnGossipHello(event, player, creature)
|
||||
player:GossipClearMenu()
|
||||
|
||||
player:GossipMenuAddItem(4, "Открыть почтовый ящик", 900001, 1)
|
||||
player:GossipMenuAddItem(1, "Открыть банк", 900001, 2)
|
||||
player:GossipMenuAddItem(6, "Открыть аукцион", 900001, 3)
|
||||
player:GossipMenuAddItem(4, "Отремонтировать снаряжение", 900001, 4)
|
||||
|
||||
player:GossipSendMenu(NPC_TEXT_ID, creature)
|
||||
end
|
||||
|
||||
local function OnGossipSelect(event, player, creature, sender, intid, code)
|
||||
if sender == 900001 then
|
||||
if intid == 1 then
|
||||
player:SendShowMailBox(creature:GetGUID())
|
||||
player:GossipComplete()
|
||||
end
|
||||
|
||||
if intid == 2 then
|
||||
player:SendShowBank(creature)
|
||||
player:GossipComplete()
|
||||
end
|
||||
|
||||
if intid == 3 then
|
||||
local x, y, z, o = player:GetLocation()
|
||||
local auctioneer_template = player:GetTeam() == 0 and ALLIANCE_AUCTIONEER_CREATURE_TEMPLATE_ID or
|
||||
HORDE_AUCTIONEER_CREATURE_TEMPLATE_ID
|
||||
local auctioneer = player:SpawnCreature(auctioneer_template, x, y, z, o, 1, 30000)
|
||||
auctioneer:SetDisplayId(11686)
|
||||
|
||||
player:SendAuctionMenu(auctioneer)
|
||||
|
||||
player:GossipComplete()
|
||||
end
|
||||
|
||||
if intid == 4 then
|
||||
player:DurabilityRepairAll()
|
||||
player:PlayDirectSound(1116)
|
||||
player:GossipComplete()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function OnLogout(event, player)
|
||||
player:RemoveSpell(SUMMON_SQUIRE_SPELL_ID)
|
||||
squires_table[player:GetGUID()] = nil
|
||||
end
|
||||
|
||||
local function OnBeforeTeleport(event, player, mapid, x, y, z, orientation, options, target)
|
||||
if not IsPremium(player) then return end
|
||||
|
||||
-- Get current generic spell (SpellType 1)
|
||||
local current_spell = player:GetCurrentSpell(1)
|
||||
|
||||
if current_spell ~= nil and current_spell:GetEntry() == HEARTHSTONE_SPELL_ID then
|
||||
player:ResetSpellCooldown(HEARTHSTONE_SPELL_ID)
|
||||
end
|
||||
end
|
||||
|
||||
RegisterCreatureGossipEvent(SQUIRE_CREATURE_TEMPLATE_ID, 1, OnGossipHello)
|
||||
RegisterCreatureGossipEvent(SQUIRE_CREATURE_TEMPLATE_ID, 2, OnGossipSelect)
|
||||
RegisterPlayerEvent(PLAYER_EVENT_ON_LOGIN, OnLogin)
|
||||
RegisterPlayerEvent(PLAYER_EVENT_ON_LOGOUT, OnLogout)
|
||||
RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, OnCommand)
|
||||
RegisterPlayerEvent(PLAYER_EVENT_ON_SPELL_CAST, OnSpellCast)
|
||||
RegisterPlayerEvent(PLAYER_EVENT_ON_BEFORE_TELEPORT, OnBeforeTeleport)
|
||||
@@ -61,9 +61,9 @@
|
||||
# false - (disabled)
|
||||
|
||||
Eluna.Enabled = true
|
||||
Eluna.TraceBack = false
|
||||
Eluna.TraceBack = true
|
||||
Eluna.ScriptPath = "lua_scripts"
|
||||
Eluna.PlayerAnnounceReload = false
|
||||
Eluna.PlayerAnnounceReload = true
|
||||
Eluna.RequirePaths = ""
|
||||
Eluna.RequireCPaths = ""
|
||||
Eluna.AutoReload = false
|
||||
|
||||
@@ -244,15 +244,13 @@ public:
|
||||
class Eluna_AllMapScript : public AllMapScript
|
||||
{
|
||||
public:
|
||||
Eluna_AllMapScript() : AllMapScript("Eluna_AllMapScript", {
|
||||
ALLMAPHOOK_ON_BEFORE_CREATE_INSTANCE_SCRIPT,
|
||||
Eluna_AllMapScript() : AllMapScript("Eluna_AllMapScript", {ALLMAPHOOK_ON_BEFORE_CREATE_INSTANCE_SCRIPT,
|
||||
ALLMAPHOOK_ON_DESTROY_INSTANCE,
|
||||
ALLMAPHOOK_ON_CREATE_MAP,
|
||||
ALLMAPHOOK_ON_DESTROY_MAP,
|
||||
ALLMAPHOOK_ON_PLAYER_ENTER_ALL,
|
||||
ALLMAPHOOK_ON_PLAYER_LEAVE_ALL,
|
||||
ALLMAPHOOK_ON_MAP_UPDATE
|
||||
}) { }
|
||||
ALLMAPHOOK_ON_MAP_UPDATE}) {}
|
||||
|
||||
void OnBeforeCreateInstanceScript(InstanceMap *instanceMap, InstanceScript **instanceData, bool /*load*/, std::string /*data*/, uint32 /*completedEncounterMask*/) override
|
||||
{
|
||||
@@ -294,12 +292,10 @@ public:
|
||||
class Eluna_AuctionHouseScript : public AuctionHouseScript
|
||||
{
|
||||
public:
|
||||
Eluna_AuctionHouseScript() : AuctionHouseScript("Eluna_AuctionHouseScript", {
|
||||
AUCTIONHOUSEHOOK_ON_AUCTION_ADD,
|
||||
Eluna_AuctionHouseScript() : AuctionHouseScript("Eluna_AuctionHouseScript", {AUCTIONHOUSEHOOK_ON_AUCTION_ADD,
|
||||
AUCTIONHOUSEHOOK_ON_AUCTION_REMOVE,
|
||||
AUCTIONHOUSEHOOK_ON_AUCTION_SUCCESSFUL,
|
||||
AUCTIONHOUSEHOOK_ON_AUCTION_EXPIRE
|
||||
}) { }
|
||||
AUCTIONHOUSEHOOK_ON_AUCTION_EXPIRE}) {}
|
||||
|
||||
void OnAuctionAdd(AuctionHouseObject *ah, AuctionEntry *entry) override
|
||||
{
|
||||
@@ -325,12 +321,10 @@ public:
|
||||
class Eluna_BGScript : public BGScript
|
||||
{
|
||||
public:
|
||||
Eluna_BGScript() : BGScript("Eluna_BGScript", {
|
||||
ALLBATTLEGROUNDHOOK_ON_BATTLEGROUND_START,
|
||||
Eluna_BGScript() : BGScript("Eluna_BGScript", {ALLBATTLEGROUNDHOOK_ON_BATTLEGROUND_START,
|
||||
ALLBATTLEGROUNDHOOK_ON_BATTLEGROUND_END,
|
||||
ALLBATTLEGROUNDHOOK_ON_BATTLEGROUND_DESTROY,
|
||||
ALLBATTLEGROUNDHOOK_ON_BATTLEGROUND_CREATE
|
||||
}) { }
|
||||
ALLBATTLEGROUNDHOOK_ON_BATTLEGROUND_CREATE}) {}
|
||||
|
||||
void OnBattlegroundStart(Battleground *bg) override
|
||||
{
|
||||
@@ -356,9 +350,7 @@ public:
|
||||
class Eluna_CommandSC : public CommandSC
|
||||
{
|
||||
public:
|
||||
Eluna_CommandSC() : CommandSC("Eluna_CommandSC", {
|
||||
ALLCOMMANDHOOK_ON_TRY_EXECUTE_COMMAND
|
||||
}) { }
|
||||
Eluna_CommandSC() : CommandSC("Eluna_CommandSC", {ALLCOMMANDHOOK_ON_TRY_EXECUTE_COMMAND}) {}
|
||||
|
||||
bool OnTryExecuteCommand(ChatHandler &handler, std::string_view cmdStr) override
|
||||
{
|
||||
@@ -395,10 +387,8 @@ public:
|
||||
class Eluna_GameEventScript : public GameEventScript
|
||||
{
|
||||
public:
|
||||
Eluna_GameEventScript() : GameEventScript("Eluna_GameEventScript", {
|
||||
GAMEEVENTHOOK_ON_START,
|
||||
GAMEEVENTHOOK_ON_STOP
|
||||
}) { }
|
||||
Eluna_GameEventScript() : GameEventScript("Eluna_GameEventScript", {GAMEEVENTHOOK_ON_START,
|
||||
GAMEEVENTHOOK_ON_STOP}) {}
|
||||
|
||||
void OnStart(uint16 eventID) override
|
||||
{
|
||||
@@ -414,14 +404,12 @@ public:
|
||||
class Eluna_GroupScript : public GroupScript
|
||||
{
|
||||
public:
|
||||
Eluna_GroupScript() : GroupScript("Eluna_GroupScript", {
|
||||
GROUPHOOK_ON_ADD_MEMBER,
|
||||
Eluna_GroupScript() : GroupScript("Eluna_GroupScript", {GROUPHOOK_ON_ADD_MEMBER,
|
||||
GROUPHOOK_ON_INVITE_MEMBER,
|
||||
GROUPHOOK_ON_REMOVE_MEMBER,
|
||||
GROUPHOOK_ON_CHANGE_LEADER,
|
||||
GROUPHOOK_ON_DISBAND,
|
||||
GROUPHOOK_ON_CREATE
|
||||
}) { }
|
||||
GROUPHOOK_ON_CREATE}) {}
|
||||
|
||||
void OnAddMember(Group *group, ObjectGuid guid) override
|
||||
{
|
||||
@@ -457,8 +445,7 @@ public:
|
||||
class Eluna_GuildScript : public GuildScript
|
||||
{
|
||||
public:
|
||||
Eluna_GuildScript() : GuildScript("Eluna_GuildScript", {
|
||||
GUILDHOOK_ON_ADD_MEMBER,
|
||||
Eluna_GuildScript() : GuildScript("Eluna_GuildScript", {GUILDHOOK_ON_ADD_MEMBER,
|
||||
GUILDHOOK_ON_REMOVE_MEMBER,
|
||||
GUILDHOOK_ON_MOTD_CHANGED,
|
||||
GUILDHOOK_ON_INFO_CHANGED,
|
||||
@@ -468,8 +455,7 @@ public:
|
||||
GUILDHOOK_ON_MEMBER_DEPOSIT_MONEY,
|
||||
GUILDHOOK_ON_ITEM_MOVE,
|
||||
GUILDHOOK_ON_EVENT,
|
||||
GUILDHOOK_ON_BANK_EVENT
|
||||
}) { }
|
||||
GUILDHOOK_ON_BANK_EVENT}) {}
|
||||
|
||||
void OnAddMember(Guild *guild, Player *player, uint8 &plRank) override
|
||||
{
|
||||
@@ -531,9 +517,7 @@ public:
|
||||
class Eluna_LootScript : public LootScript
|
||||
{
|
||||
public:
|
||||
Eluna_LootScript() : LootScript("Eluna_LootScript", {
|
||||
LOOTHOOK_ON_LOOT_MONEY
|
||||
}) { }
|
||||
Eluna_LootScript() : LootScript("Eluna_LootScript", {LOOTHOOK_ON_LOOT_MONEY}) {}
|
||||
|
||||
void OnLootMoney(Player *player, uint32 gold) override
|
||||
{
|
||||
@@ -544,9 +528,7 @@ public:
|
||||
class Eluna_MiscScript : public MiscScript
|
||||
{
|
||||
public:
|
||||
Eluna_MiscScript() : MiscScript("Eluna_MiscScript", {
|
||||
MISCHOOK_GET_DIALOG_STATUS
|
||||
}) { }
|
||||
Eluna_MiscScript() : MiscScript("Eluna_MiscScript", {MISCHOOK_GET_DIALOG_STATUS}) {}
|
||||
|
||||
void GetDialogStatus(Player *player, Object *questgiver) override
|
||||
{
|
||||
@@ -560,9 +542,7 @@ public:
|
||||
class Eluna_PetScript : public PetScript
|
||||
{
|
||||
public:
|
||||
Eluna_PetScript() : PetScript("Eluna_PetScript", {
|
||||
PETHOOK_ON_PET_ADD_TO_WORLD
|
||||
}) { }
|
||||
Eluna_PetScript() : PetScript("Eluna_PetScript", {PETHOOK_ON_PET_ADD_TO_WORLD}) {}
|
||||
|
||||
void OnPetAddToWorld(Pet *pet) override
|
||||
{
|
||||
@@ -573,8 +553,7 @@ public:
|
||||
class Eluna_PlayerScript : public PlayerScript
|
||||
{
|
||||
public:
|
||||
Eluna_PlayerScript() : PlayerScript("Eluna_PlayerScript", {
|
||||
PLAYERHOOK_ON_PLAYER_RESURRECT,
|
||||
Eluna_PlayerScript() : PlayerScript("Eluna_PlayerScript", {PLAYERHOOK_ON_PLAYER_RESURRECT,
|
||||
PLAYERHOOK_CAN_PLAYER_USE_CHAT,
|
||||
PLAYERHOOK_CAN_PLAYER_USE_PRIVATE_CHAT,
|
||||
PLAYERHOOK_CAN_PLAYER_USE_GROUP_CHAT,
|
||||
@@ -632,8 +611,8 @@ public:
|
||||
PLAYERHOOK_ON_CAN_UPDATE_SKILL,
|
||||
PLAYERHOOK_ON_BEFORE_UPDATE_SKILL,
|
||||
PLAYERHOOK_ON_UPDATE_SKILL,
|
||||
PLAYERHOOK_CAN_RESURRECT
|
||||
}) { }
|
||||
PLAYERHOOK_CAN_RESURRECT,
|
||||
PLAYERHOOK_ON_BEFORE_TELEPORT}) {}
|
||||
|
||||
void OnPlayerResurrect(Player *player, float /*restore_percent*/, bool & /*applySickness*/) override
|
||||
{
|
||||
@@ -949,15 +928,18 @@ public:
|
||||
{
|
||||
return sEluna->CanPlayerResurrect(player);
|
||||
}
|
||||
|
||||
bool OnPlayerBeforeTeleport(Player *player, uint32 mapid, float x, float y, float z, float orientation, uint32 options, Unit *target) override
|
||||
{
|
||||
return sEluna->OnPlayerBeforeTeleport(player, mapid, x, y, z, orientation, options, target);
|
||||
}
|
||||
};
|
||||
|
||||
class Eluna_ServerScript : public ServerScript
|
||||
{
|
||||
public:
|
||||
Eluna_ServerScript() : ServerScript("Eluna_ServerScript", {
|
||||
SERVERHOOK_CAN_PACKET_SEND,
|
||||
SERVERHOOK_CAN_PACKET_RECEIVE
|
||||
}) { }
|
||||
Eluna_ServerScript() : ServerScript("Eluna_ServerScript", {SERVERHOOK_CAN_PACKET_SEND,
|
||||
SERVERHOOK_CAN_PACKET_RECEIVE}) {}
|
||||
|
||||
bool CanPacketSend(WorldSession *session, WorldPacket const &packet) override
|
||||
{
|
||||
@@ -979,14 +961,12 @@ public:
|
||||
class Eluna_SpellSC : public SpellSC
|
||||
{
|
||||
public:
|
||||
Eluna_SpellSC() : SpellSC("Eluna_SpellSC", {
|
||||
ALLSPELLHOOK_ON_DUMMY_EFFECT_GAMEOBJECT,
|
||||
Eluna_SpellSC() : SpellSC("Eluna_SpellSC", {ALLSPELLHOOK_ON_DUMMY_EFFECT_GAMEOBJECT,
|
||||
ALLSPELLHOOK_ON_DUMMY_EFFECT_CREATURE,
|
||||
ALLSPELLHOOK_ON_DUMMY_EFFECT_ITEM,
|
||||
ALLSPELLHOOK_ON_CAST_CANCEL,
|
||||
ALLSPELLHOOK_ON_CAST,
|
||||
ALLSPELLHOOK_ON_PREPARE
|
||||
}) { }
|
||||
ALLSPELLHOOK_ON_PREPARE}) {}
|
||||
|
||||
void OnDummyEffect(WorldObject *caster, uint32 spellID, SpellEffIndex effIndex, GameObject *gameObjTarget) override
|
||||
{
|
||||
@@ -1053,12 +1033,10 @@ public:
|
||||
class Eluna_WorldObjectScript : public WorldObjectScript
|
||||
{
|
||||
public:
|
||||
Eluna_WorldObjectScript() : WorldObjectScript("Eluna_WorldObjectScript", {
|
||||
WORLDOBJECTHOOK_ON_WORLD_OBJECT_DESTROY,
|
||||
Eluna_WorldObjectScript() : WorldObjectScript("Eluna_WorldObjectScript", {WORLDOBJECTHOOK_ON_WORLD_OBJECT_DESTROY,
|
||||
WORLDOBJECTHOOK_ON_WORLD_OBJECT_CREATE,
|
||||
WORLDOBJECTHOOK_ON_WORLD_OBJECT_SET_MAP,
|
||||
WORLDOBJECTHOOK_ON_WORLD_OBJECT_UPDATE
|
||||
}) { }
|
||||
WORLDOBJECTHOOK_ON_WORLD_OBJECT_UPDATE}) {}
|
||||
|
||||
void OnWorldObjectDestroy(WorldObject *object) override
|
||||
{
|
||||
@@ -1085,8 +1063,7 @@ public:
|
||||
class Eluna_WorldScript : public WorldScript
|
||||
{
|
||||
public:
|
||||
Eluna_WorldScript() : WorldScript("Eluna_WorldScript", {
|
||||
WORLDHOOK_ON_OPEN_STATE_CHANGE,
|
||||
Eluna_WorldScript() : WorldScript("Eluna_WorldScript", {WORLDHOOK_ON_OPEN_STATE_CHANGE,
|
||||
WORLDHOOK_ON_BEFORE_CONFIG_LOAD,
|
||||
WORLDHOOK_ON_AFTER_CONFIG_LOAD,
|
||||
WORLDHOOK_ON_SHUTDOWN_INITIATE,
|
||||
@@ -1095,8 +1072,7 @@ public:
|
||||
WORLDHOOK_ON_STARTUP,
|
||||
WORLDHOOK_ON_SHUTDOWN,
|
||||
WORLDHOOK_ON_AFTER_UNLOAD_ALL_MAPS,
|
||||
WORLDHOOK_ON_BEFORE_WORLD_INITIALIZED
|
||||
}) { }
|
||||
WORLDHOOK_ON_BEFORE_WORLD_INITIALIZED}) {}
|
||||
|
||||
void OnOpenStateChange(bool open) override
|
||||
{
|
||||
@@ -1163,12 +1139,10 @@ public:
|
||||
class Eluna_TicketScript : public TicketScript
|
||||
{
|
||||
public:
|
||||
Eluna_TicketScript() : TicketScript("Eluna_TicketScript", {
|
||||
TICKETHOOK_ON_TICKET_CREATE,
|
||||
Eluna_TicketScript() : TicketScript("Eluna_TicketScript", {TICKETHOOK_ON_TICKET_CREATE,
|
||||
TICKETHOOK_ON_TICKET_UPDATE_LAST_CHANGE,
|
||||
TICKETHOOK_ON_TICKET_CLOSE,
|
||||
TICKETHOOK_ON_TICKET_RESOLVE
|
||||
}) { }
|
||||
TICKETHOOK_ON_TICKET_RESOLVE}) {}
|
||||
|
||||
void OnTicketCreate(GmTicket *ticket) override
|
||||
{
|
||||
|
||||
@@ -233,6 +233,7 @@ namespace Hooks
|
||||
PLAYER_EVENT_ON_AURA_APPLY = 64, // (event, player, aura)
|
||||
PLAYER_EVENT_ON_HEAL = 65, // (event, player, target, gain) - Can return new heal amount
|
||||
PLAYER_EVENT_ON_DAMAGE = 66, // (event, player, target, damage) - Can return new damage amount
|
||||
PLAYER_EVENT_ON_BEFORE_TELEPORT = 67, // (event, player, mapid, x, y, z, orientation, options, target)
|
||||
|
||||
PLAYER_EVENT_COUNT
|
||||
};
|
||||
|
||||
@@ -497,6 +497,7 @@ public:
|
||||
void OnPlayerAuraApply(Player* player, Aura* aura);
|
||||
void OnPlayerHeal(Player* player, Unit* target, uint32& gain);
|
||||
void OnPlayerDamage(Player* player, Unit* target, uint32& gain);
|
||||
bool OnPlayerBeforeTeleport(Player* player, uint32 mapid, float x, float y, float z, float orientation, uint32 options, Unit* target);
|
||||
|
||||
/* Vehicle */
|
||||
void OnInstall(Vehicle* vehicle);
|
||||
|
||||
@@ -826,3 +826,19 @@ void Eluna::OnPlayerDamage(Player* player, Unit* target, uint32& damage)
|
||||
|
||||
CleanUpStack(3);
|
||||
}
|
||||
|
||||
bool Eluna::OnPlayerBeforeTeleport(Player* player, uint32 mapid, float x, float y, float z, float orientation, uint32 options, Unit* target)
|
||||
{
|
||||
START_HOOK_WITH_RETVAL(PLAYER_EVENT_ON_BEFORE_TELEPORT, true);
|
||||
|
||||
Push(player);
|
||||
Push(mapid);
|
||||
Push(x);
|
||||
Push(y);
|
||||
Push(z);
|
||||
Push(orientation);
|
||||
Push(options);
|
||||
Push(target);
|
||||
|
||||
return CallAllFunctionsBool(PlayerEventBindings, key, true);
|
||||
}
|
||||
|
||||
@@ -785,6 +785,7 @@ namespace LuaGlobalFunctions
|
||||
* PLAYER_EVENT_ON_AURA_APPLY = 64, // (event, player, aura)
|
||||
* PLAYER_EVENT_ON_HEAL = 65, // (event, player, target, heal) - Can return new heal amount
|
||||
* PLAYER_EVENT_ON_DAMAGE = 66, // (event, player, target, damage) - Can return new damage amount
|
||||
* PLAYER_EVENT_ON_BEFORE_TELEPORT = 67, // (event, player, target, damage) - Can return new damage amount
|
||||
* };
|
||||
* </pre>
|
||||
*
|
||||
|
||||
@@ -0,0 +1,376 @@
|
||||
-- Create Squire NPC
|
||||
INSERT
|
||||
INTO
|
||||
acore_world.creature_template (entry,
|
||||
difficulty_entry_1,
|
||||
difficulty_entry_2,
|
||||
difficulty_entry_3,
|
||||
KillCredit1,
|
||||
KillCredit2,
|
||||
name,
|
||||
subname,
|
||||
IconName,
|
||||
gossip_menu_id,
|
||||
minlevel,
|
||||
maxlevel,
|
||||
`exp`,
|
||||
faction,
|
||||
npcflag,
|
||||
speed_walk,
|
||||
speed_run,
|
||||
speed_swim,
|
||||
speed_flight,
|
||||
detection_range,
|
||||
`rank`,
|
||||
dmgschool,
|
||||
DamageModifier,
|
||||
BaseAttackTime,
|
||||
RangeAttackTime,
|
||||
BaseVariance,
|
||||
RangeVariance,
|
||||
unit_class,
|
||||
unit_flags,
|
||||
unit_flags2,
|
||||
dynamicflags,
|
||||
family,
|
||||
`type`,
|
||||
type_flags,
|
||||
lootid,
|
||||
pickpocketloot,
|
||||
skinloot,
|
||||
PetSpellDataId,
|
||||
VehicleId,
|
||||
mingold,
|
||||
maxgold,
|
||||
AIName,
|
||||
MovementType,
|
||||
HoverHeight,
|
||||
HealthModifier,
|
||||
ManaModifier,
|
||||
ArmorModifier,
|
||||
ExperienceModifier,
|
||||
RacialLeader,
|
||||
movementId,
|
||||
RegenHealth,
|
||||
flags_extra,
|
||||
ScriptName,
|
||||
VerifiedBuild)
|
||||
VALUES
|
||||
(9000001,
|
||||
29831,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
'Eluna Squire',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
81,
|
||||
81,
|
||||
2,
|
||||
21,
|
||||
69,341,185,
|
||||
1.0,
|
||||
1.42857,
|
||||
1.0,
|
||||
1.0,
|
||||
20.0,
|
||||
1,
|
||||
0,
|
||||
7.5,
|
||||
2000,
|
||||
2000,
|
||||
1.0,
|
||||
1.0,
|
||||
1,
|
||||
64,
|
||||
2048,
|
||||
8,
|
||||
0,
|
||||
6,
|
||||
72,
|
||||
100003,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1163,
|
||||
1524,
|
||||
'PassiveAI',
|
||||
0,
|
||||
1.0,
|
||||
4.0,
|
||||
1.0,
|
||||
1.0,
|
||||
2.5,
|
||||
0,
|
||||
144,
|
||||
1,
|
||||
0,
|
||||
'',
|
||||
12340) ON DUPLICATE KEY UPDATE entry = entry;
|
||||
|
||||
|
||||
-- Add Squire localization
|
||||
INSERT INTO
|
||||
acore_world.creature_template_locale (entry,
|
||||
locale,
|
||||
Name,
|
||||
Title,
|
||||
VerifiedBuild)
|
||||
VALUES
|
||||
(9000001,
|
||||
'ruRU',
|
||||
'Оруженосец',
|
||||
'',
|
||||
12340) ON DUPLICATE KEY UPDATE entry = entry;
|
||||
|
||||
|
||||
-- Add Squire model
|
||||
INSERT
|
||||
INTO
|
||||
acore_world.creature_template_model (CreatureID,
|
||||
Idx,
|
||||
CreatureDisplayID,
|
||||
DisplayScale,
|
||||
Probability,
|
||||
VerifiedBuild)
|
||||
VALUES
|
||||
(9000001,
|
||||
0,
|
||||
16927,
|
||||
1.0,
|
||||
1.0,
|
||||
12340) ON
|
||||
DUPLICATE KEY
|
||||
UPDATE
|
||||
CreatureID = CreatureID;
|
||||
|
||||
-- Add Squire dialogue text
|
||||
INSERT
|
||||
INTO
|
||||
acore_world.npc_text (ID,
|
||||
text0_0,
|
||||
text0_1,
|
||||
BroadcastTextID0,
|
||||
lang0,
|
||||
Probability0,
|
||||
em0_0,
|
||||
em0_1,
|
||||
em0_2,
|
||||
em0_3,
|
||||
em0_4,
|
||||
em0_5,
|
||||
text1_0,
|
||||
text1_1,
|
||||
BroadcastTextID1,
|
||||
lang1,
|
||||
Probability1,
|
||||
em1_0,
|
||||
em1_1,
|
||||
em1_2,
|
||||
em1_3,
|
||||
em1_4,
|
||||
em1_5,
|
||||
text2_0,
|
||||
text2_1,
|
||||
BroadcastTextID2,
|
||||
lang2,
|
||||
Probability2,
|
||||
em2_0,
|
||||
em2_1,
|
||||
em2_2,
|
||||
em2_3,
|
||||
em2_4,
|
||||
em2_5,
|
||||
text3_0,
|
||||
text3_1,
|
||||
BroadcastTextID3,
|
||||
lang3,
|
||||
Probability3,
|
||||
em3_0,
|
||||
em3_1,
|
||||
em3_2,
|
||||
em3_3,
|
||||
em3_4,
|
||||
em3_5,
|
||||
text4_0,
|
||||
text4_1,
|
||||
BroadcastTextID4,
|
||||
lang4,
|
||||
Probability4,
|
||||
em4_0,
|
||||
em4_1,
|
||||
em4_2,
|
||||
em4_3,
|
||||
em4_4,
|
||||
em4_5,
|
||||
text5_0,
|
||||
text5_1,
|
||||
BroadcastTextID5,
|
||||
lang5,
|
||||
Probability5,
|
||||
em5_0,
|
||||
em5_1,
|
||||
em5_2,
|
||||
em5_3,
|
||||
em5_4,
|
||||
em5_5,
|
||||
text6_0,
|
||||
text6_1,
|
||||
BroadcastTextID6,
|
||||
lang6,
|
||||
Probability6,
|
||||
em6_0,
|
||||
em6_1,
|
||||
em6_2,
|
||||
em6_3,
|
||||
em6_4,
|
||||
em6_5,
|
||||
text7_0,
|
||||
text7_1,
|
||||
BroadcastTextID7,
|
||||
lang7,
|
||||
Probability7,
|
||||
em7_0,
|
||||
em7_1,
|
||||
em7_2,
|
||||
em7_3,
|
||||
em7_4,
|
||||
em7_5,
|
||||
VerifiedBuild)
|
||||
VALUES
|
||||
(10000000,
|
||||
'',
|
||||
'By the grace of the stars, I have been bound to your side, $n. This ancient pile of bones is ready to serve you.',
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
0.0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0) ON DUPLICATE KEY UPDATE ID = ID;
|
||||
|
||||
-- Add squire dialogue text locale
|
||||
INSERT
|
||||
INTO
|
||||
acore_world.npc_text_locale (ID,
|
||||
Locale,
|
||||
Text0_0,
|
||||
Text0_1,
|
||||
Text1_0,
|
||||
Text1_1,
|
||||
Text2_0,
|
||||
Text2_1,
|
||||
Text3_0,
|
||||
Text3_1,
|
||||
Text4_0,
|
||||
Text4_1,
|
||||
Text5_0,
|
||||
Text5_1,
|
||||
Text6_0,
|
||||
Text6_1,
|
||||
Text7_0,
|
||||
Text7_1)
|
||||
VALUES
|
||||
(10000000,
|
||||
'ruRU',
|
||||
'',
|
||||
'Милостью высших сил я был приставлен к тебе, $n. Эти древние кости готовы служить. Чего желаешь?',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'') ON DUPLICATE KEY UPDATE ID = ID;
|
||||
|
||||
|
||||
@@ -278,15 +278,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData)
|
||||
AH->houseId = AuctionHouseId::Neutral;
|
||||
else
|
||||
{
|
||||
CreatureData const* auctioneerData = sObjectMgr->GetCreatureData(creature->GetSpawnId());
|
||||
if (!auctioneerData)
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Data for auctioneer not found ({})", auctioneer.ToString());
|
||||
delete AH;
|
||||
return;
|
||||
}
|
||||
|
||||
CreatureTemplate const* auctioneerInfo = sObjectMgr->GetCreatureTemplate(auctioneerData->id);
|
||||
CreatureTemplate const *auctioneerInfo = creature->GetCreatureTemplate();
|
||||
if (!auctioneerInfo)
|
||||
{
|
||||
LOG_ERROR("network.opcode", "Non existing auctioneer ({})", auctioneer.ToString());
|
||||
|
||||
Reference in New Issue
Block a user