diff --git a/Bosskiller.lua b/Bosskiller.lua new file mode 100644 index 0000000..f73e052 --- /dev/null +++ b/Bosskiller.lua @@ -0,0 +1,44 @@ +-- DEVKM +local T = {} + +local function KilledCreature(event, player, enemy) + if(not enemy:IsWorldBoss()) then return end -- No jefe del mundo, omita + local pguid, cguid = player:GetGUIDLow(), enemy:GetGUIDLow() -- obtener guids + + local ktime = 0 -- obtener time (default to 0) + if(T[pguid] and T[pguid][cguid]) then + ktime = os.time() - T[pguid][cguid] -- (now - start) = passed time (seconds) + T[pguid][cguid] = nil -- erase record + end + + local participants + if(player:IsInGroup()) then + participants = "con sus amigos (Total: "..player:GetGroup():GetMembersCount().." chicos, " + else + participants = "Solo! (" + end + + SendWorldMessage("[PVE] |Hplayer:"..player:GetName().."|h["..player:GetName().."]|h asesina a ["..enemy:GetName().."] "..participants.."Estuvo: "..ktime.." segundos)") +end + +local function EnterCombat(event, player, enemy) + if(not enemy:IsWorldBoss()) then return end -- not world boss, skip saving time etc + local pguid, cguid = player:GetGUIDLow(), enemy:GetGUIDLow() -- obtener guids + + if(not T[pguid]) then -- if the player doesnt have a table + T[pguid] = {} -- create a new table for him + elseif(T[pguid][cguid]) then -- check that we are not already in combat with the creature (already saved a time) + return -- we are, already a time saved. Stop before saving + end + T[pguid][cguid] = os.time() -- save combat start time +end + +local function LeaveCombat(event, player) + if(T[player:GetGUIDLow()]) then + T[player:GetGUIDLow()] = nil -- erase combat time records + end +end + +RegisterPlayerEvent(7, KilledCreature) -- executes when a player kills a creature +RegisterPlayerEvent(33, EnterCombat) -- executes on each player attack attempt (spammy) +RegisterPlayerEvent(34, LeaveCombat) -- executes when a player leaves combat \ No newline at end of file diff --git a/Buffos.lua b/Buffos.lua new file mode 100644 index 0000000..f5c6eed --- /dev/null +++ b/Buffos.lua @@ -0,0 +1,23 @@ +--DEVKM +local Cost = 10000 +local BUFFIDS = {48074, 48170, 43223, 36880, 467, 48469, 48162} +local POWERBUFFIDS = {48074, 48170, 43223, 36880, 467, 48469, 48162, 41924} + +function Buff(event, player, message, type, language) + if(message:lower() == "#buff") then + if (player:GetCoinage() >= Cost) then + player:ModifyMoney(-Cost) -- Remove this line if you don't want player to loose golds. + for k, v in pairs(POWERBUFFIDS) do + player:AddAura(v, player) + end + else + for k, v in pairs(BUFFIDS) do + player:AddAura(v, player) + end + end + player:SendBroadcastMessage("|cff00ff00Recibes un par de Buff!|r") + return false + end +end + +RegisterPlayerEvent(18, Buff) \ No newline at end of file diff --git a/Cambio_genero.lua b/Cambio_genero.lua new file mode 100644 index 0000000..8b4210c --- /dev/null +++ b/Cambio_genero.lua @@ -0,0 +1,32 @@ +--DEVKM +local NPC_ENTRY = 190003 + +function ChangeGenderMenu(event, player, unit) + if player:GetGender() == 0 then + player:GossipMenuAddItem(0, "Cambiar a Mujer", 0, 1) + else + player:GossipMenuAddItem(0, "Cambiar a Hombre", 0, 2) + end + player:GossipMenuAddItem(0, "Olvidalo..", 0, 3) + player:GossipSendMenu(1, unit) +end + +function ChangeGenderSelect(event, player, unit, sender, intid, code) + if (intid == 1) then + player:SendBroadcastMessage("|cFFFFA500Tu genero se cambio con exito!") + player:SetGender(1) + player:SaveToDB() + player:GossipComplete() + elseif (intid == 2) then + player:SendBroadcastMessage("|cFFFFA500Tu genero se cambio con exito!") + player:SetGender(0) + player:SaveToDB() + player:GossipComplete() + elseif (intid == 3) then + player:GossipComplete() + end +end + + +RegisterCreatureGossipEvent(NPC_ENTRY, 1, ChangeGenderMenu) +RegisterCreatureGossipEvent(NPC_ENTRY, 2, ChangeGenderSelect) \ No newline at end of file diff --git a/Cambio_moneda.lua b/Cambio_moneda.lua new file mode 100644 index 0000000..1f5c58d --- /dev/null +++ b/Cambio_moneda.lua @@ -0,0 +1,41 @@ +-- DEVKM +-- No borrar los derechos de autor +-- 2015 + +local NPC_ENTRY = 54 -- ID del NPC + +local ITEM_1 = 57000 -- ID del item + +local CANTIDAD_1 = 1 -- Cantidad a entregar + +local NOMBRE_1 = GetItemLink(ITEM_1) + +local function ItemExChangeOnHello(event, player, unit) + player:GossipMenuAddItem(0, "Cambiar honor x" ..NOMBRE_1.."", 0, 1) + player:GossipMenuAddItem(0, "Salir..", 0, 2) + player:GossipSendMenu(1, unit) +end + +local function ItemExChangeOnSelect(event, Player, unit, sender, intid, code) + if (intid == 1) then + if (Player:GetHonorPoints(10) <=10 )then + Player:SendBroadcastMessage("|CFF7BBEF7 No tienes el suficiente honor") + return false; + end + if (Player:GetHonorPoints(10) >=10 )then + Player:SendBroadcastMessage("|CFF7BBEF7 Se ha añadido " ..NOMBRE_1.. "|r") + Player:AddItem(ITEM_1, CANTIDAD_1) + Player:ModifyHonorPoints(-10) + Player:GossipComplete() + return false; + end + elseif (intid == 2) then + Player:GossipComplete() + end + if (intid == 2) then + Player:GossipComplete() + end +end + +RegisterCreatureGossipEvent(NPC_ENTRY, 1, ItemExChangeOnHello) +RegisterCreatureGossipEvent(NPC_ENTRY, 2, ItemExChangeOnSelect) \ No newline at end of file diff --git a/DuelReset.lua b/DuelReset.lua new file mode 100644 index 0000000..0a5e651 --- /dev/null +++ b/DuelReset.lua @@ -0,0 +1,20 @@ +function duelreset(event, winner, loser, type) + winner:ResetAllCooldowns() --Removes winner's CD + loser:ResetAllCooldowns() --Removes loser's CD + winner:SetHealth(winner:GetMaxHealth()) --Restores winner's Health + loser:SetHealth(loser:GetMaxHealth()) --Restores loser's Health + winner:SetPower(0, winner:GetMaxPower(0)) --Restores winner's Mana + loser:SetPower(0, loser:GetMaxPower(0)) --Restores loser's Mana + winner:SetPower(1, winner:GetMaxPower(1)) --Restores winner's Rage + loser:SetPower(1, loser:GetMaxPower(1)) --Restores loser's Rage + winner:SetPower(2, winner:GetMaxPower(2)) --Restores winner's Focus + loser:SetPower(2, loser:GetMaxPower(2)) --Restores loser's Focus + winner:SetPower(3, winner:GetMaxPower(3)) --Restores winner's Energy + loser:SetPower(3, loser:GetMaxPower(3)) --Restores loser's Energy + winner:SetPower(5, winner:GetMaxPower(5)) --Restores winner's Runes + loser:SetPower(5, loser:GetMaxPower(5)) --Restores loser's Runes + winner:SetPower(6, winner:GetMaxPower(6)) --Restores winner's Runic Power + loser:SetPower(6, loser:GetMaxPower(6)) --Restores loser's Runic Power +end + +RegisterPlayerEvent(11, duelreset) diff --git a/GM_Announcer.lua b/GM_Announcer.lua new file mode 100644 index 0000000..e0186db --- /dev/null +++ b/GM_Announcer.lua @@ -0,0 +1,22 @@ +local ChatPrefix = "#announce" + +if (ChatPrefix:sub(-1) ~= " ") then + ChatPrefix = ChatPrefix.." "; +end + +local function ChatSystem(event, player, msg, _, lang) + if (msg:sub(1, ChatPrefix:len()) == ChatPrefix) then + if player:IsGM() then + -- local t = table.concat({"|cff7DFF00[", player:GetName(), "]:|r ", msg:sub(ChatPrefix:len()+1), ""}); + local t = table.concat({msg:sub(ChatPrefix:len()+1),}); + for _, p in ipairs(GetPlayersInWorld()) do + player:SendChatMessageToPlayer(40, 0, t, p) + end + else + PrintInfo("No eres GM o estas en modo OFF") + end + return false; + end +end + +RegisterPlayerEvent(18, ChatSystem) \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e516c8a --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# TrinityCore-335a +TrinityCore Release 335a + +FixCore es una empresa de desarrollo con especialidad en el juego world of warcraft. @FixStore - @FixDevs - @FixCMS son propiedad de @FixCore. + +El 80% de los trabajos que realiza @FixCore y sus demás subempresas son de manera gratuita sin embargo el 20% de los demás trabajos suelen ser de cobro debido a que se pudo haber requerido de algún pago extra para algún template, linea etc.. No acepte cosas de cobro que estén a nombre de @FixCore sin que usted esté seguro de que sea de manera legal ** En caso de tener dudas, inquietudes o desea contactarnos puede enviarnos un E-Mail ** fixcore2@gmail.com + +--- + +FixCore is a development company specializing in the game world of warcraft. @FixStore - @FixDevs - @FixCMS Are owned by @FixCore. + +80% of the work done @FixCore and other sub-companies are free however 20% of other jobs usually collection because it could have required some extra payment for a template, line etc .. Do not accept things that are a collection @FixCore name without you sure it legally ** If you have questions, concerns or want to contact you can send an E-Mail ** fixcore2@gmail.com diff --git a/Reload_LUA.lua b/Reload_LUA.lua new file mode 100644 index 0000000..066486c --- /dev/null +++ b/Reload_LUA.lua @@ -0,0 +1,12 @@ +--DEVKM +function reloadElunaEngine(event, player, command) + if command == "reload scripts" or command == "km" then + if player == nil or player:IsGM() then -- console or gm + ReloadEluna() + else + player:SendBroadcastMessage("Debes activar el modo para poder usar este comando") + end + end +end + +RegisterPlayerEvent(42, reloadElunaEngine) \ No newline at end of file diff --git a/Transfigurador.lua b/Transfigurador.lua new file mode 100644 index 0000000..3e13adc --- /dev/null +++ b/Transfigurador.lua @@ -0,0 +1,508 @@ +--DEVKM +local NPC_Entry = 190004 + +local RequireGold = 1 +local GoldModifier = 1.0 +local GoldCost = 100000 + +local RequireToken = false +local TokenEntry = 49426 +local TokenAmount = 1 + +local AllowMixedArmorTypes = false +local AllowMixedWeaponTypes = false + +local Qualities = +{ + [0] = false, -- AllowPoor + [1] = false, -- AllowCommon + [2] = true , -- AllowUncommon + [3] = true , -- AllowRare + [4] = true , -- AllowEpic + [5] = false, -- AllowLegendary + [6] = false, -- AllowArtifact + [7] = true , -- AllowHeirloom +} + +local EQUIPMENT_SLOT_START = 0 +local EQUIPMENT_SLOT_HEAD = 0 +local EQUIPMENT_SLOT_NECK = 1 +local EQUIPMENT_SLOT_SHOULDERS = 2 +local EQUIPMENT_SLOT_BODY = 3 +local EQUIPMENT_SLOT_CHEST = 4 +local EQUIPMENT_SLOT_WAIST = 5 +local EQUIPMENT_SLOT_LEGS = 6 +local EQUIPMENT_SLOT_FEET = 7 +local EQUIPMENT_SLOT_WRISTS = 8 +local EQUIPMENT_SLOT_HANDS = 9 +local EQUIPMENT_SLOT_FINGER1 = 10 +local EQUIPMENT_SLOT_FINGER2 = 11 +local EQUIPMENT_SLOT_TRINKET1 = 12 +local EQUIPMENT_SLOT_TRINKET2 = 13 +local EQUIPMENT_SLOT_BACK = 14 +local EQUIPMENT_SLOT_MAINHAND = 15 +local EQUIPMENT_SLOT_OFFHAND = 16 +local EQUIPMENT_SLOT_RANGED = 17 +local EQUIPMENT_SLOT_TABARD = 18 +local EQUIPMENT_SLOT_END = 19 + +local INVENTORY_SLOT_BAG_START = 19 +local INVENTORY_SLOT_BAG_END = 23 + +local INVENTORY_SLOT_ITEM_START = 23 +local INVENTORY_SLOT_ITEM_END = 39 + +local INVTYPE_CHEST = 5 +local INVTYPE_WEAPON = 13 +local INVTYPE_ROBE = 20 +local INVTYPE_WEAPONMAINHAND = 21 +local INVTYPE_WEAPONOFFHAND = 22 + +local ITEM_CLASS_WEAPON = 2 +local ITEM_CLASS_ARMOR = 4 + +local ITEM_SUBCLASS_WEAPON_BOW = 2 +local ITEM_SUBCLASS_WEAPON_GUN = 3 +local ITEM_SUBCLASS_WEAPON_CROSSBOW = 18 +local ITEM_SUBCLASS_WEAPON_FISHING_POLE = 20 + +local EXPANSION_WOTLK = 2 +local EXPANSION_TBC = 2 +local PLAYER_VISIBLE_ITEM_1_ENTRYID +local ITEM_SLOT_MULTIPLIER +if GetCoreExpansion() < EXPANSION_TBC then + PLAYER_VISIBLE_ITEM_1_ENTRYID = 260 + ITEM_SLOT_MULTIPLIER = 12 +elseif GetCoreExpansion() < EXPANSION_WOTLK then + PLAYER_VISIBLE_ITEM_1_ENTRYID = 346 + ITEM_SLOT_MULTIPLIER = 16 +else + PLAYER_VISIBLE_ITEM_1_ENTRYID = 283 + ITEM_SLOT_MULTIPLIER = 2 +end + +local INVENTORY_SLOT_BAG_0 = 255 + +local SlotNames = { + [EQUIPMENT_SLOT_HEAD ] = {"Cabeza", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_SHOULDERS ] = {"Espalda", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_BODY ] = {"Camisa", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_CHEST ] = {"Pecho", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_WAIST ] = {"Cintura", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_LEGS ] = {"Piernas", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_FEET ] = {"Pies", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_WRISTS ] = {"Muñecas", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_HANDS ] = {"Manos", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_BACK ] = {"Atras", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_MAINHAND ] = {"Una mano", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_OFFHAND ] = {"Mano opcional", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_RANGED ] = {"A distancia", nil, nil, nil, nil, nil, nil, nil, nil}, + [EQUIPMENT_SLOT_TABARD ] = {"Tabardo", nil, nil, nil, nil, nil, nil, nil, nil}, +} +local Locales = { + {"Actualizar menu", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Eliminar todas las transfiguraciones", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Eliminar transfiguraciones equipadas?", nil, nil, nil, nil, nil, nil, nil, nil}, + {"El uso de este artiulo para transfigurar se unira a ti y al hacerlo no son reembolsables ni transladables.\nQuieres continuar?", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Remove transmogrification from %s?", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Atras..", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Eliminar transfiguracion", nil, nil, nil, nil, nil, nil, nil, nil}, + {"transfiguraciones retiradas de objetos equipados", nil, nil, nil, nil, nil, nil, nil, nil}, + {"No tiene articulos transfigurados equipados", nil, nil, nil, nil, nil, nil, nil, nil}, + {"%s transfiguracion eliminada", nil, nil, nil, nil, nil, nil, nil, nil}, + {"No se encuentra una transfiguracion en %s", nil, nil, nil, nil, nil, nil, nil, nil}, + {"%s Transfigurado!", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Los elementos seleccionados no son adecuados", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Elemento seleccionado no existe", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Equipo ranura esta vacia", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Usted no tiene suficiente %ss", nil, nil, nil, nil, nil, nil, nil, nil}, + {"Dinero insuficiente", nil, nil, nil, nil, nil, nil, nil, nil}, +} +local function LocText(id, p) -- "%s":format("test") + if Locales[id] then + local s = Locales[id][p:GetDbcLocale()+1] or Locales[id][1] + if s then + return s + end + end + return "Text not found: "..(id or 0) +end +--[[ +typedef UNORDERED_MAP transmogData +typedef UNORDERED_MAP transmogMap +static transmogMap entryMap -- entryMap[pGUID][iGUID] = entry +static transmogData dataMap -- dataMap[iGUID] = pGUID +]] +local entryMap = {} +local dataMap = {} + +local function GetSlotName(slot, locale) + if not SlotNames[slot] then return end + return SlotNames[slot][locale and locale+1 or 1] +end + +local function GetFakePrice(item) + local sellPrice = item:GetSellPrice() + local minPrice = 10000 + if sellPrice < minPrice then + sellPrice = minPrice + end + return sellPrice +end + +local function GetFakeEntry(item) + local guid = item and item:GetGUIDLow() + if guid and dataMap[guid] then + if entryMap[dataMap[guid]] then + return entryMap[dataMap[guid]][guid] + end + end +end + +local function DeleteFakeFromDB(itemGUID) + if dataMap[itemGUID] then + if entryMap[dataMap[itemGUID]] then + entryMap[dataMap[itemGUID]][itemGUID] = nil + end + dataMap[itemGUID] = nil + end + CharDBExecute("DELETE FROM custom_transmogrification WHERE GUID = "..itemGUID) +end + +local function DeleteFakeEntry(item) + if not GetFakeEntry(item) then + return false + end + item:GetOwner():UpdateUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (item:GetSlot() * ITEM_SLOT_MULTIPLIER), item:GetEntry()) + DeleteFakeFromDB(item:GetGUIDLow()) + return true +end + +local function SetFakeEntry(item, entry) + local player = item:GetOwner() + if player then + local pGUID = player:GetGUIDLow() + local iGUID = item:GetGUIDLow() + player:UpdateUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (item:GetSlot() * ITEM_SLOT_MULTIPLIER), entry) + if not entryMap[pGUID] then + entryMap[pGUID] = {} + end + entryMap[pGUID][iGUID] = entry + dataMap[iGUID] = pGUID + CharDBExecute("REPLACE INTO custom_transmogrification (GUID, FakeEntry, Owner) VALUES ("..iGUID..", "..entry..", "..pGUID..")") + end +end + +local function IsRangedWeapon(Class, SubClass) + return Class == ITEM_CLASS_WEAPON and ( + SubClass == ITEM_SUBCLASS_WEAPON_BOW or + SubClass == ITEM_SUBCLASS_WEAPON_GUN or + SubClass == ITEM_SUBCLASS_WEAPON_CROSSBOW) +end + +local function SuitableForTransmogrification(player, transmogrified, transmogrifier) + if not transmogrified or not transmogrifier then + return false + end + + if not Qualities[transmogrifier:GetQuality()] then + return false + end + + if not Qualities[transmogrified:GetQuality()] then + return false + end + + if transmogrified:GetDisplayId() == transmogrifier:GetDisplayId() then + return false + end + + local fentry = GetFakeEntry(transmogrified) + if fentry and fentry == transmogrifier:GetEntry() then + return false + end + + if not player:CanUseItem(transmogrifier) then + return false + end + + local fierClass = transmogrifier:GetClass() + local fiedClass = transmogrified:GetClass() + local fierSubClass = transmogrifier:GetSubClass() + local fiedSubClass = transmogrified:GetSubClass() + local fierInventorytype = transmogrifier:GetInventoryType() + local fiedInventorytype = transmogrified:GetInventoryType() + + if fiedInventorytype == INVTYPE_BAG or + fiedInventorytype == INVTYPE_RELIC or + -- fiedInventorytype == INVTYPE_BODY or + fiedInventorytype == INVTYPE_FINGER or + fiedInventorytype == INVTYPE_TRINKET or + fiedInventorytype == INVTYPE_AMMO or + fiedInventorytype == INVTYPE_QUIVER then + return false + end + + if fierClass ~= fiedClass then + return false + end + + if IsRangedWeapon(fiedClass, fiedSubClass) ~= IsRangedWeapon(fierClass, fierSubClass) then + return false + end + + if fierSubClass ~= fiedSubClass and not IsRangedWeapon(fiedClass, fiedSubClass) then + if fierClass == ITEM_CLASS_ARMOR and not AllowMixedArmorTypes then + return false + end + if fierClass == ITEM_CLASS_WEAPON and not AllowMixedWeaponTypes then + return false + end + end + + if fierInventorytype ~= fiedInventorytype and + (fierClass ~= ITEM_CLASS_WEAPON or (fiedInventorytype ~= INVTYPE_WEAPON or fierInventorytype ~= INVTYPE_WEAPONOFFHAND or fierInventorytype ~= INVTYPE_WEAPONMAINHAND)) and + (fierClass ~= ITEM_CLASS_ARMOR or ((fierInventorytype ~= INVTYPE_CHEST or fiedInventorytype ~= INVTYPE_ROBE) and (fierInventorytype ~= INVTYPE_ROBE or fiedInventorytype ~= INVTYPE_CHEST))) then + return false + end + + return true +end + +local menu_id = math.random(1000) + +local function OnGossipHello(event, player, creature) + player:GossipClearMenu() + for slot = EQUIPMENT_SLOT_START, EQUIPMENT_SLOT_END-1 do + local transmogrified = player:GetItemByPos(INVENTORY_SLOT_BAG_0, slot) + if transmogrified then + if Qualities[transmogrified:GetQuality()] then + local slotName = GetSlotName(slot, player:GetDbcLocale()) + if slotName then + player:GossipMenuAddItem(3, slotName, EQUIPMENT_SLOT_END, slot) + end + end + end + end + player:GossipMenuAddItem(4, LocText(2, player), EQUIPMENT_SLOT_END+2, 0, false, LocText(3, player), 0) + player:GossipMenuAddItem(7, LocText(1, player), EQUIPMENT_SLOT_END+1, 0) + player:GossipSendMenu(100, creature, menu_id) +end + +local _items = {} +local function OnGossipSelect(event, player, creature, slotid, uiAction) + if slotid == EQUIPMENT_SLOT_END then -- Show items you can use + local transmogrified = player:GetItemByPos(INVENTORY_SLOT_BAG_0, uiAction) + if transmogrified then + local lowGUID = player:GetGUIDLow() + _items[lowGUID] = {} -- Remove this with logix + local limit = 0 + local price = 0 + if RequireGold == 1 then + price = GetFakePrice(transmogrified)*GoldModifier + elseif RequireGold == 2 then + price = GoldCost + end + + for i = INVENTORY_SLOT_ITEM_START, INVENTORY_SLOT_ITEM_END-1 do + if limit > 30 then + break + end + local transmogrifier = player:GetItemByPos(INVENTORY_SLOT_BAG_0, i) + if transmogrifier then + local display = transmogrifier:GetDisplayId() + if SuitableForTransmogrification(player, transmogrified, transmogrifier) then + if not _items[lowGUID][display] then + limit = limit + 1 + _items[lowGUID][display] = {transmogrifier:GetBagSlot(), transmogrifier:GetSlot()} + local popup = LocText(4, player).."\n\n"..transmogrifier:GetItemLink(player:GetDbcLocale()).."\n" + if RequireToken then + popup = popup.."\n"..TokenAmount.." x "..GetItemLink(TokenEntry, player:GetDbcLocale()) + end + player:GossipMenuAddItem(4, transmogrifier:GetItemLink(player:GetDbcLocale()), uiAction, display, false, popup, price) + end + end + end + end + + for i = INVENTORY_SLOT_BAG_START, INVENTORY_SLOT_BAG_END-1 do + local bag = player:GetItemByPos(INVENTORY_SLOT_BAG_0, i) + if bag then + for j = 0, bag:GetBagSize()-1 do + if limit > 30 then + break + end + local transmogrifier = player:GetItemByPos(i, j) + if transmogrifier then + local display = transmogrifier:GetDisplayId() + if SuitableForTransmogrification(player, transmogrified, transmogrifier) then + if not _items[lowGUID][display] then + limit = limit + 1 + _items[lowGUID][display] = {transmogrifier:GetBagSlot(), transmogrifier:GetSlot()} + player:GossipMenuAddItem(4, transmogrifier:GetItemLink(player:GetDbcLocale()), uiAction, display, false, popup, price) + end + end + end + end + end + end + + player:GossipMenuAddItem(4, LocText(7, player), EQUIPMENT_SLOT_END+3, uiAction, false, LocText(5, player):format(GetSlotName(uiAction, player:GetDbcLocale()))) + player:GossipMenuAddItem(7, LocText(6, player), EQUIPMENT_SLOT_END+1, 0) + player:GossipSendMenu(100, creature, menu_id) + else + OnGossipHello(event, player, creature) + end + elseif slotid == EQUIPMENT_SLOT_END+1 then -- Back + OnGossipHello(event, player, creature) + elseif slotid == EQUIPMENT_SLOT_END+2 then -- Remove Transmogrifications + local removed = false + for slot = EQUIPMENT_SLOT_START, EQUIPMENT_SLOT_END-1 do + local transmogrifier = player:GetItemByPos(INVENTORY_SLOT_BAG_0, slot) + if transmogrifier then + if DeleteFakeEntry(transmogrifier) and not removed then + removed = true + end + end + end + if removed then + player:SendAreaTriggerMessage(LocText(8, player)) + -- player:PlayDirectSound(3337) + else + player:SendNotification(LocText(9, player)) + end + OnGossipHello(event, player, creature) + elseif slotid == EQUIPMENT_SLOT_END+3 then -- Remove Transmogrification from single item + local transmogrifier = player:GetItemByPos(INVENTORY_SLOT_BAG_0, uiAction) + if transmogrifier then + if DeleteFakeEntry(transmogrifier) then + player:SendAreaTriggerMessage(LocText(10, player):format(GetSlotName(uiAction, player:GetDbcLocale()))) + -- player:PlayDirectSound(3337) + else + player:SendNotification(LocText(11, player):format(GetSlotName(uiAction, player:GetDbcLocale()))) + end + end + OnGossipSelect(event, player, creature, EQUIPMENT_SLOT_END, uiAction) + else -- Transmogrify + local lowGUID = player:GetGUIDLow() + if not RequireToken or player:GetItemCount(TokenEntry) >= TokenAmount then + local transmogrified = player:GetItemByPos(INVENTORY_SLOT_BAG_0, slotid) + if transmogrified then + if _items[lowGUID] and _items[lowGUID][uiAction] and _items[lowGUID][uiAction] then + local transmogrifier = player:GetItemByPos(_items[lowGUID][uiAction][1], _items[lowGUID][uiAction][2]) + if transmogrifier:GetOwnerGUID() == player:GetGUID() and (transmogrifier:IsInBag() or transmogrifier:GetBagSlot() == INVENTORY_SLOT_BAG_0) and SuitableForTransmogrification(player, transmogrified, transmogrifier) then + local price + if RequireGold == 1 then + price = GetFakePrice(transmogrified)*GoldModifier + elseif RequireGold == 2 then + price = GoldCost + end + if price then + if player:GetCoinage() >= price then + player:ModifyMoney(-1*price) + if RequireToken then + player:RemoveItem(TokenEntry, TokenAmount) + end + SetFakeEntry(transmogrified, transmogrifier:GetEntry()) + -- transmogrifier:SetNotRefundable(player) + transmogrifier:SetBinding(true) + -- player:PlayDirectSound(3337) + player:SendAreaTriggerMessage(LocText(12, player):format(GetSlotName(slotid, player:GetDbcLocale()))) + else + player:SendNotification(LocText(17, player)) + end + end + else + player:SendNotification(LocText(13, player)) + end + else + player:SendNotification(LocText(14, player)) + end + else + player:SendNotification(LocText(15, player)) + end + else + player:SendNotification(LocText(16, player):format(GetItemLink(TokenEntry, player:GetDbcLocale()))) + end + _items[lowGUID] = {} + OnGossipSelect(event, player, creature, EQUIPMENT_SLOT_END, slotid) + end +end + +local function OnLogin(event, player) + local playerGUID = player:GetGUIDLow() + entryMap[playerGUID] = {} + local result = CharDBQuery("SELECT GUID, FakeEntry FROM custom_transmogrification WHERE Owner = "..playerGUID) + if result then + repeat + local itemGUID = result:GetUInt32(0) + local fakeEntry = result:GetUInt32(1) + -- if sObjectMgr:GetItemTemplate(fakeEntry) then + -- { + dataMap[itemGUID] = playerGUID + entryMap[playerGUID][itemGUID] = fakeEntry + -- } + -- else + -- sLog:outError(LOG_FILTER_SQL, "Item entry (Entry: %u, itemGUID: %u, playerGUID: %u) does not exist, deleting.", fakeEntry, itemGUID, playerGUID) + -- Transmogrification::DeleteFakeFromDB(itemGUID) + -- end + until not result:NextRow() + + for slot = EQUIPMENT_SLOT_START, EQUIPMENT_SLOT_END-1 do + local item = player:GetItemByPos(INVENTORY_SLOT_BAG_0, slot) + if item then + if entryMap[playerGUID] then + if entryMap[playerGUID][item:GetGUIDLow()] then + player:UpdateUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (item:GetSlot() * ITEM_SLOT_MULTIPLIER), entryMap[playerGUID][item:GetGUIDLow()]) + end + end + end + end + end +end + +local function OnLogout(event, player) + local pGUID = player:GetGUIDLow() + entryMap[pGUID] = nil +end + +local function OnEquip(event, player, item, bag, slot) + local fentry = GetFakeEntry(item) + if fentry then + if item:GetOwnerGUID() ~= player:GetGUID() then + DeleteFakeFromDB(item:GetGUIDLow()) + return + end + player:SetUInt32Value(PLAYER_VISIBLE_ITEM_1_ENTRYID + (slot * ITEM_SLOT_MULTIPLIER), fentry) + end +end + +-- Note, Query is instant when Execute is delayed +CharDBQuery([[ +CREATE TABLE IF NOT EXISTS `custom_transmogrification` ( +`GUID` INT(10) UNSIGNED NOT NULL COMMENT 'Item guidLow', +`FakeEntry` INT(10) UNSIGNED NOT NULL COMMENT 'Item entry', +`Owner` INT(10) UNSIGNED NOT NULL COMMENT 'Player guidLow', +PRIMARY KEY (`GUID`) +) +COMMENT='version 4.0' +COLLATE='latin1_swedish_ci' +ENGINE=InnoDB; +]]) + +print("Eliminando entradas de transfiguración...") +CharDBQuery("DELETE FROM custom_transmogrification WHERE NOT EXISTS (SELECT 1 FROM item_instance WHERE item_instance.guid = custom_transmogrification.GUID)") + +RegisterPlayerEvent(3, OnLogin) +RegisterPlayerEvent(4, OnLogout) +RegisterPlayerEvent(29, OnEquip) + +RegisterCreatureGossipEvent(NPC_Entry, 1, OnGossipHello) +RegisterCreatureGossipEvent(NPC_Entry, 2, OnGossipSelect) + +local plrs = GetPlayersInWorld() +if plrs then + for k, player in ipairs(plrs) do + OnLogin(k, player) + end +end \ No newline at end of file diff --git a/broadcast.lua b/broadcast.lua new file mode 100644 index 0000000..01ddc8c --- /dev/null +++ b/broadcast.lua @@ -0,0 +1,61 @@ +local Broadcast = { + Register = { + -- {"String", day, time} + -- Day is from 1 to 7, where Monday is 1 and Sunday is 7 + -- Time is either seconds if day is 0 or format hour.minutes if day is specified + {"|cff00ff00|TInterface\\icons\\inv_staff_104:15|t Anuncio", 0, 1900}, + } +} + +local function SeparateTime(t) + local h = math.floor(t) + local m = ((t*1000)-(h*1000))/10 + return h, m; +end + +local function GetTimeDiff(weekday, h, m, s) + local d = os.date("*t") + + d.sec = s or 0 + d.min = m + d.hour = h + + local ddiff = weekday-d.wday+1 + d.day = d.day+ddiff + local now = os.date("*t") + if (ddiff < 0) then + -- Take into consideration that it is tuesday and we want monday + d.day = d.day+7 + elseif (ddiff == 0 and d.hour*60*60+d.min*60+d.sec < now.hour*60*60+now.min*60+now.sec) then + -- Take into consideration that it is the same date, but its already past the wanted time + d.day = d.day+7 + end + + -- get final times + local e = os.time(d) + local diff = e-os.time() -- this is the time in seconds until the wanted date is achieved + + return diff; +end + +function Broadcast.SendAndReset(msg, d, t) + SendWorldMessage(msg) + if(d > 0) then + local regtime = GetTimeDiff(d, SeparateTime(t)) + CreateLuaEvent(function() Broadcast.SendAndReset(msg, d, t) end, regtime*1000, 1) + end +end + +function Broadcast.OnLoad() + for i, v in ipairs(Broadcast.Register) do + local msg, d, t = table.unpack(Broadcast.Register[i]) + if d == 0 then + CreateLuaEvent(function() Broadcast.SendAndReset(msg, d, t) end, t*1000, 0) + else + local regtime = GetTimeDiff(d, SeparateTime(t)) + CreateLuaEvent(function() Broadcast.SendAndReset(msg, d, t) end, regtime*1000, 1) + end + end +end + +Broadcast.OnLoad() \ No newline at end of file diff --git a/chat_rank.lua b/chat_rank.lua new file mode 100644 index 0000000..fba95bd --- /dev/null +++ b/chat_rank.lua @@ -0,0 +1,56 @@ +-- Blocked words go in this table. +local blockedWords = { + "shit", + "fuck", + "bitch" +}; +-- The string which the blocked word should be +-- replaced with. +local strReplacement = "^$@!"; +-- Function to check for blocked words and fix +-- the message. +local function blockWords(str) + local words = {}; + -- Grabbing all the words and putting them in a table. + str:gsub("(%w+)", function (w) table.insert(words, w); end); + -- Replacing bad words with the 'strReplacement'. + for _, word in ipairs(words) do + for _, badWord in ipairs(blockedWords) do + if word:lower() == badWord:lower() then return true; end + end + end + return false; +end + +-- What are these for? +local ChatPrefix = ""; +local WorldChannelName = ""; + +-- I am going to assume that the indexes +-- here are correct. +local Gmrank = { + [0] = " |cff00ffffFOD User|r ", + [1] = " |cffFF8400VIP 1 User |r", + [2] = " |cffFC3F00VIP 2 User |r", + [3] = " |cffFC3F00VIP| |r", + [5] = " |cff00ffffFOD User|r ", + [6] = " |cff00ffffFOD User|r ", + [10] = " |cff00ffffFOD User|r ", + [11] = " |cff00ffffFOD User|r ", + [12] = " |cff00ffffFOD User|r ", + [13] = " |cff00ffffFOD User|r ", + [14] = " |cff00ffffFOD User|r ", + [15] = " |cff00ffffFOD User|r ", + [254] = "|cffDE2E2ECo.Inhaber |r", + [255] = "|cffFF0000FoD Owner |r" +}; +function ChatSystemSay(_, player, msg) + if msg:find(ChatPrefix) == 1 then + -- Filter the string for bad words. + if not blockWords(msg) then + player:SendUnitSay(Gmrank[player:GetGMRank()] .. msg, 0) + end + return false; + end +end +RegisterPlayerEvent(18, ChatSystemSay) \ No newline at end of file diff --git a/chest_system.lua b/chest_system.lua new file mode 100644 index 0000000..4b2f385 --- /dev/null +++ b/chest_system.lua @@ -0,0 +1,80 @@ +-- Name: Daily Chest System +-- Details: Limits the amount of time between the same chest being opened by the same player. +-- Usage: Modify the configuration below to suit your needs. +-- Website: https://github.com/RStijn + +-- Init +local CHEST = {} + +-- Config +-- set chest gameobject ID's at bottom +local HOURS = 24 -- How many hours before a player can loot again +local ACCOUNTLIMIT = true -- TRUE: Limits entire account. FALSE: Limits only this character +-- Message to show when player already looted a chest recently +local ALREADYLOOTED = "You already looted this chest. Please check back within 24 hours." +-- GameObject ID's you want to limit per player. +CHEST[1] = 500000 +CHEST[2] = 500001 +CHEST[3] = 500002 + + +-- Functions +local function registerNewLoot(pid, goGuid) + CharDBQuery("INSERT INTO `looted_chests` (`player`, `objectGuid`, `lootTime`) VALUES ('".. pid .. "', '" .. goGuid .. "', UNIX_TIMESTAMP());") +end + +local function canLoot(pid, goGuid) + local q = CharDBQuery("SELECT `id`, `lootTime` FROM `looted_chests` WHERE `player` = " .. pid .. " AND `objectGuid` = " .. goGuid .. ";") + local now = tonumber(CharDBQuery("SELECT UNIX_TIMESTAMP()"):GetRow(1)["UNIX_TIMESTAMP()"]) + + -- if possible + if q == nil then + return true + elseif tonumber(q:GetRow(1)["lootTime"]) + (HOURS * 3600) < now then + CharDBQuery("DELETE FROM `looted_chests` WHERE `id` = "..q:GetRow(1)["id"]) + return true + else + return false + end +end + +local function blockLoot(player, go) + go:SetLootState(3) + player:SendBroadcastMessage(ALREADYLOOTED); +end + +local function handleLoot(player, go) + -- Get ID's + local pid = 0 + if ACCOUNTLIMIT then + pid = player:GetAccountId() + else + pid = player:GetPlayerGUID() + end + local goGuid = go:GetGUIDLow() + + -- Handle loot + if canLoot(pid, goGuid) then + registerNewLoot(pid, goGuid) + else + blockLoot(player, go) + end +end + +local function onLootStateChanged(event, go, state) + if state == 2 then + player = go:GetLootRecipient() + handleLoot(player, go) + end + +end + +-- Register chests +local i = 1 +while CHEST[i] do + RegisterGameObjectEvent(CHEST[i], 9, onLootStateChanged) + i = i + 1 +end + +-- Create sql table if needed +CharDBQuery("CREATE TABLE IF NOT EXISTS `looted_chests` (`id` int(11) NOT NULL AUTO_INCREMENT, `player` int(11) NOT NULL, `objectGuid` int(11) NOT NULL, `lootTime` int(11) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;") diff --git a/commandst.lua b/commandst.lua new file mode 100644 index 0000000..0b98482 --- /dev/null +++ b/commandst.lua @@ -0,0 +1,11 @@ +local function Start (event, player, command) + if (command == "st" or command == "start") then + if (player:IsInCombat() == true) then + player:SendNotification("You are in combat") + else + player:ResetSpellCooldown(7355) + player:CastSpell(player, 7355, false) + end + end +end +RegisterPlayerEvent(42, Start) diff --git a/encantamientos.lua b/encantamientos.lua new file mode 100644 index 0000000..4e13708 --- /dev/null +++ b/encantamientos.lua @@ -0,0 +1,217 @@ +local npcid = 54 + +local T = { + ["Menu"] = { + {"Headpiece", 0}, + {"Shoulders", 2}, + {"Chest", 4}, + {"Legs", 6}, + {"Boots", 7}, + {"Bracers", 8}, + {"Gloves", 9}, + {"Cloak", 14}, + {"Main-Hand Weapons", 15}, + {"Two-Handed Weapons", 151}, + {"Off-Hand Weapons", 16}, + {"Shields", 161}; + }, + + [0] = { -- Headpiece + {"Arcanum of Burning Mysteries", 3820, false}, + {"Arcanum of Blissful Mending", 3819, false}, + {"Arcanum of the Stalward Protector", 3818, false}, + {"Arcanum of Torment", 3817, false}, + {"Arcanum of the Savage Gladiator", 3842, false}, + {"Arcanum of Triumph", 3795, false}, + {"Arcanum of Dominance", 3797, false}; + }, + + [2] = { -- Shoulders + {"Inscription of Triumph", 3793, false}, + {"Inscription of Dominance", 3794, false}, + {"Greater Inscription of the Gladiator", 3852, false}, + {"Greater Inscription of the Axe", 3808, false}, + {"Greater Inscription of the Crag", 3809, false}, + {"Greater Inscription of the Pinnacle", 3811, false}, + {"Greater Inscription of the Storm", 3810, false}; + }, + + [4] = { -- Chest + {"Enchant Chest - Powerful Stats", 3832, false}, + {"Enchant Chest - Super Health", 3297, false}, + {"Enchant Chest - Greater Mana Restoration", 2381, false}, + {"Enchant Chest - Exceptional Resilience", 3245, false}, + {"Enchant Chest - Greater Defense", 1953, false}; + }, + + [6] = { -- Legs + {"Earthen Leg Armor", 3853, false}, + {"Frosthide Leg Armor", 3822, false}, + {"Icescale Leg Armor", 3823, false}, + {"Brilliant Spellthread", 3719, false}, + {"Sapphire Spellthread", 3721, false}; + }, + + [7] = { -- Boots + {"Enchant Boots - Greater Assault", 1597, false}, + {"Enchant Boots - Tuskars Vitality", 3232, false}, + {"Enchant Boots - Superior Agility", 983, false}, + {"Enchant Boots - Greater Spirit", 1147, false}, + {"Enchant Boots - Greater Vitality", 3244, false}, + {"Enchant Boots - Icewalker", 3826, false}, + {"Enchant Boots - Greater Fortitude", 1075, false}; + }, + + [8] = { -- Bracers + {"Enchant Bracers - Major Stamina", 3850, false}, + {"Enchant Bracers - Superior Spellpower", 2332, false}, + {"Enchant Bracers - Greater Assault", 3845, false}, + {"Enchant Bracers - Major Spirit", 1147, false}, + {"Enchant Bracers - Expertise", 3231, false}, + {"Enchant Bracers - Greater Stats", 2661, false}, + {"Enchant Bracers - Exceptional Intellect", 1119, false}; + }, + + [9] = { -- Gloves + {"Enchant Gloves - Greater Blasting", 3249, false}, + {"Enchant Gloves - Armsman", 3253, false}, + {"Enchant Gloves - Crusher", 1603, false}, + {"Enchant Gloves - Agility", 3222, false}, + {"Enchant Gloves - Precision", 3234, false}, + {"Enchant Gloves - Expertise", 3231, false}, + {"Enchant Gloves - Exceptional Spellpower", 3246, false}; + }, + + [14] = { -- Cloak + {"Enchant Cloak - Shadow Armor", 3256, false}, + {"Enchant Cloak - Wisdom", 3296, false}, + {"Enchant Cloak - Titan Weave", 1951, false}, + {"Enchant Cloak - Greater Speed", 3831, false}, + {"Enchant Cloak - Mighty Armor", 3294, false}, + {"Enchant Cloak - Major Agility", 1099, false}, + {"Enchant Cloak - Spell Piercing", 1262, false}; + }, + + [15] = { + -- Main Hand + {"Enchant Weapon - Titan Guard", 3851, false}, + {"Enchant Weapon - Accuracy", 3788, false}, + {"Enchant Weapon - Berserking", 3789, false}, + {"Enchant Weapon - Black Magic", 3790, false}, + {"Enchant Weapon - Mighty Spellpower", 3834, false}, + {"Enchant Weapon - Superior Potency", 3833, false}, + {"Enchant Weapon - Ice Breaker", 3239, false}, + {"Enchant Weapon - Lifeward", 3241, false}, + {"Enchant Weapon - Blood Draining", 3870, false}, + {"Enchant Weapon - Blade Ward", 3869, false}, + {"Enchant Weapon - Exceptional Agility", 1103, false}, + {"Enchant Weapon - Exceptional Spirit", 3844, false}, + {"Enchant Weapon - Executioner", 3225, false}, + {"Enchant Weapon - Mongoose", 2673, false}, + + -- Two-Handed + {"Enchant 2H Weapon - Massacre", 3827, true}, + {"Enchant 2H Weapon - Scourgebane", 3247, true}, + {"Enchant 2H Weapon - Giant Slayer", 3251, true}, + {"Enchant 2H Weapon - Greater Spellpower", 3854, true}; + }, + + [16] = { + -- Offhand + {"Enchant Weapon - Titan Guard", 3851, false}, + {"Enchant Weapon - Accuracy", 3788, false}, + {"Enchant Weapon - Berserking", 3789, false}, + {"Enchant Weapon - Black Magic", 3790, false}, + {"Enchant Weapon - Mighty Spellpower", 3834, false}, + {"Enchant Weapon - Superior Potency", 3833, false}, + {"Enchant Weapon - Ice Breaker", 3239, false}, + {"Enchant Weapon - Lifeward", 3241, false}, + {"Enchant Weapon - Blood Draining", 3870, false}, + {"Enchant Weapon - Blade Ward", 3869, false}, + {"Enchant Weapon - Exceptional Agility", 1103, false}, + {"Enchant Weapon - Exceptional Spirit", 3844, false}, + {"Enchant Weapon - Executioner", 3225, false}, + {"Enchant Weapon - Mongoose", 2673, false}, + + -- Shields + {"Enchant Shield - Defense", 1952, true}, + {"Enchant Shield - Greater Intellect", 1128, true}, + {"Enchant Shield - Shield Block", 2655, true}, + {"Enchant Shield - Resilience", 3229, true}, + {"Enchant Shield - Major Stamina", 1071, true}, + {"Enchant Shield - Tough Shield", 2653, true}; + }, +}; +local pVar = {}; + +function Enchanter(event, plr, unit) + pVar[plr:GetName()] = nil; + + for _, v in ipairs(T["Menu"]) do + plr:GossipMenuAddItem(3, "|cFF008000Enchant "..v[1]..".|R", 0, v[2]) + end + plr:GossipSendMenu(1, unit) +end + +function EnchanterSelect(event, plr, unit, sender, intid, code) + if (intid < 500) then + local ID = intid + local f + if(intid == 161 or intid == 151) then + ID = math.floor(intid/10) + f = true + end + pVar[plr:GetName()] = intid; + if(T[ID]) then + for i, v in ipairs(T[ID]) do + if((not f and not v[3]) or (f and v[3])) then + plr:GossipMenuAddItem(3, "|cFF008000Enchant "..v[1]..".|R", 0, v[2]) + end + end + end + plr:GossipMenuAddItem(3, "[Back]", 0, 500) + plr:GossipSendMenu(1, unit) + elseif (intid == 500) then + Enchanter(event, plr, unit) + elseif (intid >= 900) then + local ID = pVar[plr:GetName()] + if(ID == 161 or ID == 151) then + ID = math.floor(ID/10) + end + for k, v in pairs(T[ID]) do + if v[2] == intid then + local item = plr:GetEquippedItemBySlot(ID) + if item then + if v[3] then + local WType = item:GetSubClass() + if pVar[plr:GetName()] == 151 then + if(WType == 1 or WType == 5 or WType == 6 or WType == 8 or WType == 10) then + item:ClearEnchantment(0,0) + item:SetEnchantment(intid, 0, 0) + else + plr:SendAreaTriggerMessage("You do not have a Two-Handed Weapon equipped!") + end + elseif pVar[plr:GetName()] == 161 then + if(WType == 6) then + item:ClearEnchantment(0,0) + item:SetEnchantment(intid, 0, 0) + else + plr:SendAreaTriggerMessage("You do not have a Shield equipped!") + end + end + else + item:ClearEnchantment(0,0) + item:SetEnchantment(intid, 0, 0) + plr:CastSpell(plr, 36937) + end + else + plr:SendAreaTriggerMessage("You have no item to enchant in the selected slot!") + end + end + end + EnchanterSelect(event, plr, unit, sender, pVar[plr:GetName()], nil) + end +end + +RegisterCreatureGossipEvent(npcid, 1, Enchanter) +RegisterCreatureGossipEvent(npcid, 2, EnchanterSelect) \ No newline at end of file diff --git a/eventos.lua b/eventos.lua new file mode 100644 index 0000000..b38d28a --- /dev/null +++ b/eventos.lua @@ -0,0 +1,88 @@ +--[[ + Do not repost without my permission. + Do not take credits for what you haven't scripted. + +------------------------------------------------------ + - Developer: Hei + - Complete: 100% with ElunaTrinityCata + - ScriptName: 'Eventsystem' +]]-- + + +local EventActivateMsg = "#start" +local EventDeactivateMsg = "#stop" +local JoinMsg = "#join" +local Project = "Pandorum Event System" + +local EventActivated = false +local ReviveActivated = false + + +local EventPlace = {} + +function EventChatSystem(event, player, message, type, language) + if (message == EventActivateMsg) then + if (player:GetGMRank() >= 2) then + if (EventActivated == true) then + player:SendBroadcastMessage("Zurzeit ist bereits ein Event gestartet worden. Bitte Stopt dieses um ein neues Event zu starten!") + else + EventActivated = true + table.insert(EventPlace, player:GetMapId()) + table.insert(EventPlace, player:GetX()) + table.insert(EventPlace, player:GetY()) + table.insert(EventPlace, player:GetZ()) + table.insert(EventPlace, player:GetZoneId()) + local plrs = GetPlayersInWorld() + for k, v in pairs(plrs) do + v:SendBroadcastMessage("|cff3399FF[", Project, "]: |cffDFDF18"..player:GetName().." |cffEB0000hat ein Event gestartet, gebt "..JoinMsg.." um beizutreten!") + v:SendAreaTriggerMessage("|cff3399FF[", Project, "]: |cffDFDF18"..player:GetName().." |cffEB0000hat ein Event gestartet, gebt "..JoinMsg.." um beizutreten!") + return false + end + end + end + end + if (message == EventDeactivateMsg) then + if (player:GetGMRank() == 4) or (player:GetGMRank() >= 2) then + if (EventActivated == false) then + player:SendBroadcastMessage("Es ist keine Event Aktiviert um es zu schliessen.") + else + EventActivated = false + EventPlace = {} + local plrs = GetPlayersInWorld() + for k, v in pairs(plrs) do + v:SendBroadcastMessage("|cff3399FF[", Project, "]: |cffDFDF18" ..player:GetName().." |cffEB0000hat das Event beendet!") + v:SendAreaTriggerMessage("|cff3399FF[", Project, "]: |cffDFDF18" ..player:GetName().." |cffEB0000hat das Event beendet!") + return false + end + end + end + end + if (message == JoinMsg) then + if (EventActivated == false) then + player:SendBroadcastMessage("Zurzeit findet keine Event statt.") + elseif (EventActivated == true) then + player:SendAreaTriggerMessage("|cffEB0000Viel Spa\195\159 beim Event |cffDFDF18" ..player:GetName().." |cffEB0000:D") + + player:Teleport(EventPlace[1], EventPlace[2], EventPlace[3], EventPlace[4], EventPlace[5]) + return false + end + end + + if (message == Remind) then + if (EventActivated == false) then + player:SendBroadcastMessage("Sie koennen diesen Befehl nur ausfuehren wenn ein Event aktiv ist.") + else + local plrs = GetPlayersInWorld() + for k, v in pairs(plrs) do + v:SendBroadcastMessage("Es ist bereits ein Event gestartet gebe bitte "..JoinMsg.." ein um daran teil zunehmen.") + return false + end + end + end +end + + +RegisterPlayerEvent(18, EventChatSystem) +RegisterPlayerEvent(21, EventChatSystem) +RegisterPlayerEvent(22, EventChatSystem) +RegisterPlayerEvent(20, EventChatSystem) \ No newline at end of file diff --git a/expira_al_desconectar.lua b/expira_al_desconectar.lua new file mode 100644 index 0000000..8d1e449 --- /dev/null +++ b/expira_al_desconectar.lua @@ -0,0 +1,4 @@ +function LogoutItem(event, player) +player:RemoveItem(ItemId,ItemCount) +end +RegisterPlayerEvent(4,LogoutItem) \ No newline at end of file diff --git a/global_trainer.lua b/global_trainer.lua new file mode 100644 index 0000000..ce529f7 --- /dev/null +++ b/global_trainer.lua @@ -0,0 +1,926 @@ +--- Script Lua Engine TrinityCore 3.3.5 +--- By Kusanagy Azakura +--- Developers & Customizers +--- Thanks to: Tommy, for teaching the local Classes = { + + + +local UnitEntry = 999995 +local IconMoney = "|TInterface\\icons\\INV_Misc_Coin_02:15|t" + +local Classes = { + [1] = "|TInterface\\icons\\INV_Sword_27.png:25|t|cFFA52A2A[Warrior Trainer]", -- Warrior + [2] = "|TInterface\\icons\\INV_Hammer_01.png:25|t|cFFF58CBA[Paladin Trainer]", -- Paladin + [3] = "|TInterface\\icons\\INV_Weapon_Bow_07.png:25|t|cFFABD473[Hunter Trainer]", -- Hunter + [4] = "|TInterface\\icons\\INV_ThrowingKnife_04.png:25|t|cFFFFF569[Rogue Trainer]", -- Rogue + [5] = "|TInterface\\icons\\INV_Staff_30.png:25|t|cFFFFFFFF[Priest Trainer]", -- Priest + [6] = "|TInterface\\icons\\Spell_Deathknight_ClassIcon.png:25|t|cFFC41F3B[Death Trainer]", -- Death Knight + [7] = "|TInterface\\icons\\inv_jewelry_talisman_04.png:25|t|cFF0070DE[Shaman Trainer]", -- Shaman + [8] = "|TInterface\\icons\\INV_Staff_30.png:25|t|cFF69CCF0[Mage Trainer]", -- Mage + [9] = "|TInterface\\icons\\INV_Staff_30.png:25|t|cFF9482C9[Warlock Trainer]", -- Warlock + [10] = "", -- Unk + [11] = "[|TInterface\\icons\\Ability_Druid_Maul.png:25|t|cFFFF7d0A[Druid Trainer]" -- Druid +}; + +function Trainers_Gossip(unit, player, creature) +if (player:GetLevel() >= 80) then + if player:GetClass() == 1 then -- Warrior + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,1) + elseif player:GetClass() == 2 then -- Paladin + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,2) + elseif player:GetClass() == 3 then -- Hunter + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,3) + elseif player:GetClass() == 4 then -- Rogue + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,4) + elseif player:GetClass() == 5 then -- Priest + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,5) + elseif player:GetClass() == 6 then -- Death Knight + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,6) + elseif player:GetClass() == 7 then -- Shaman + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,7) + elseif player:GetClass() == 8 then -- Mage + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,8) + elseif player:GetClass() == 9 then -- Warlock + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,9) + elseif player:GetClass() == 11 then -- Druid + player:GossipMenuAddItem(3,""..Classes[player:GetClass()].." |cFFFF0000[Costs 500 "..IconMoney.."]",0,10) + end + end + +player:GossipMenuAddItem(3,"|TInterface\\icons\\Achievement_BG_returnXflags_def_WSG:25|t|cFF000000[|r|cFF800000Reset Talent Points|cFF000000]",0,11) +player:GossipMenuAddItem(3, "|TInterface/ICONS/Ability_Warrior_OffensiveStance:25|t|cFF8B0000Learn Weapon Skills.", 0, 99940) +player:GossipMenuAddItem(3, "|TInterface/ICONS/Ability_Warrior_Disarm:25|t|cFF8B0000Advance All Weapon Skills", 0, 99941) +player:GossipMenuAddItem(3, "|TInterface/ICONS/Ability_Warrior_TitansGrip:25|t|cFF008000Dual-Wield", 0, 99942) +player:GossipMenuAddItem(3, "|TInterface/ICONS/INV_Jewelry_Talisman_02:25|t|cFF0000FFArtisan Riding", 0, 99943) +player:GossipMenuAddItem(3, "|TInterface/ICONS/ABILITY_MAGE_INVISIBILITY:25|t|cFF00FF00Buff me Please",0, 99944) +player:GossipMenuAddItem(2, "|TInterface/ICONS/Achievement_Boss_Kael'thasSunstrider_01:25|t|cFF008000Morphing Service", 0, 99945) +player:GossipMenuAddItem(3,"|TInterface\\icons\\Ability_Vehicle_LoadSelfCatapult:25|t|cFF000000[|r|cFF800000Nevermind|cFF000000]",0,999) +player:GossipSendMenu(1, creature) +end + + + + +function Menu_Trainers_Select(event, player, creature, sender, intid, code) +if (intid < 11 and intid > 0) then + if (player:ModifyMoney(-5000000) == false) then + intid = 0 + player:SendBroadcastMessage("You don't have enough gold") + player:GossipComplete() + end +end + + + if(intid == 99945) then +player:GossipMenuAddItem(7, "|TInterface/ICONS/Achievement_Character_Troll_Male:25|tTroll Faction", 0, 9700) +player:GossipMenuAddItem(7, "|TInterface/ICONS/Achievement_Character_Bloodelf_Female:25|tBloodelf Faction", 0, 9701) +player:GossipMenuAddItem(7, "|TInterface/ICONS/Achievement_Character_Draenei_Female:25|tDraenei Faction", 0, 9702) +player:GossipMenuAddItem(7, "|TInterface/ICONS/Achievement_Character_Gnome_Female:25|tGnomish Faction", 0, 9703) +player:GossipMenuAddItem(7, "|TInterface/ICONS/Achievement_Character_Tauren_Male:25|tTauren Faction", 0, 9704) +player:GossipMenuAddItem(7, "|TInterface/ICONS/Achievement_Character_Nightelf_Male:25|tNightElf Faction", 0, 9705) +player:GossipMenuAddItem(7, "|TInterface/ICONS/Achievement_Character_Dwarf_Male:25|tDwarf Faction", 0, 9706) +player:GossipMenuAddItem(7, "|TInterface/ICONS/Achievement_Character_Orc_Female:25|tOrchish Faction", 0, 9707) +player:GossipMenuAddItem(3,"|TInterface\\icons\\Ability_Vehicle_LoadSelfCatapult:25|t|cFF000000[|r|cFF800000Nevermind|cFF000000]",0,999) +player:GossipSendMenu(1, creature) +end + + +-- class train + + if (intid == 1) then -- Warrior + player:LearnSpell(2457) + player:LearnSpell(47436) + player:LearnSpell(47450) + player:LearnSpell(11578) + player:LearnSpell(47465) + player:LearnSpell(47502) + player:LearnSpell(34428) + player:LearnSpell(1715) + player:LearnSpell(2687) + player:LearnSpell(71) + player:LearnSpell(7386) + player:LearnSpell(355) + player:LearnSpell(72) + player:LearnSpell(47437) + player:LearnSpell(57823) + player:LearnSpell(694) + player:LearnSpell(2565) + player:LearnSpell(676) + player:LearnSpell(47520) + player:LearnSpell(20230) + player:LearnSpell(12678) + player:LearnSpell(47471) + player:LearnSpell(1161) + player:LearnSpell(871) + player:LearnSpell(2458) + player:LearnSpell(20252) + player:LearnSpell(47475) + player:LearnSpell(18499) + player:LearnSpell(1680) + player:LearnSpell(6552) + player:LearnSpell(47488) + player:LearnSpell(1719) + player:LearnSpell(23920) + player:LearnSpell(47440) + player:LearnSpell(3411) + player:LearnSpell(64382) + player:LearnSpell(55694) + player:LearnSpell(57755) + player:LearnSpell(674) + player:LearnSpell(750) + player:LearnSpell(5246) + + if (player:HasSpell(12294)) then + player:LearnSpell(47486) + end + + if (player:HasSpell(20243)) then + player:LearnSpell(47498) +end +end + + + if (intid == 2) then -- paladin + player:LearnSpell(750) + player:LearnSpell(48942) + player:LearnSpell(48782) + player:LearnSpell(48932) + player:LearnSpell(20271) + player:LearnSpell(498) + player:LearnSpell(853) + player:LearnSpell(1152) + player:LearnSpell(10278) + player:LearnSpell(48788) + player:LearnSpell(53408) + player:LearnSpell(48950) + player:LearnSpell(48936) + player:LearnSpell(31789) + player:LearnSpell(62124) + player:LearnSpell(54043) + player:LearnSpell(25780) + player:LearnSpell(1044) + player:LearnSpell(20217) + player:LearnSpell(48819) + player:LearnSpell(48801) + player:LearnSpell(48785) + player:LearnSpell(5502) + player:LearnSpell(20164) + player:LearnSpell(10326) + player:LearnSpell(1038) + player:LearnSpell(53407) + player:LearnSpell(48943) + player:LearnSpell(20165) + player:LearnSpell(48945) + player:LearnSpell(642) + player:LearnSpell(48947) + player:LearnSpell(20166) + player:LearnSpell(4987) + player:LearnSpell(48806) + player:LearnSpell(6940) + player:LearnSpell(48817) + player:LearnSpell(48934) + player:LearnSpell(48938) + player:LearnSpell(25898) + player:LearnSpell(25899) + player:LearnSpell(32223) + player:LearnSpell(31884) + player:LearnSpell(54428) + player:LearnSpell(61411) + player:LearnSpell(53601) + player:LearnSpell(33388) + player:LearnSpell(33391) + player:LearnSpell(34769) + player:LearnSpell(34767) + player:LearnSpell(19746) + if (player:GetTeam() < 1) then + player:LearnSpell(31801) + else + player:LearnSpell(53736) + end + + if (player:HasSpell(20925)) then + player:LearnSpell(48952) + end + + if (player:HasSpell(31935)) then + player:LearnSpell(48827) + end + + if (player:HasSpell(20473)) then + player:LearnSpell(48825) + end +end + + if (intid == 4) then -- Rogue + player:LearnSpell(674) + player:LearnSpell(48668) + player:LearnSpell(48638) + player:LearnSpell(1784) + player:LearnSpell(48657) + player:LearnSpell(921) + player:LearnSpell(1776) + player:LearnSpell(26669) + player:LearnSpell(51724) + player:LearnSpell(6774) + player:LearnSpell(11305) + player:LearnSpell(1766) + player:LearnSpell(48676) + player:LearnSpell(48659) + player:LearnSpell(1804) + player:LearnSpell(8647) + player:LearnSpell(48691) + player:LearnSpell(51722) + player:LearnSpell(48672) + player:LearnSpell(1725) + player:LearnSpell(26889) + player:LearnSpell(2836) + player:LearnSpell(1833) + player:LearnSpell(1842) + player:LearnSpell(8643) + player:LearnSpell(2094) + player:LearnSpell(1860) + player:LearnSpell(57993) + player:LearnSpell(48674) + player:LearnSpell(31224) + player:LearnSpell(5938) + player:LearnSpell(57934) + player:LearnSpell(51723) + + if (player:HasSpell(16511)) then + player:LearnSpell(48660) + end + + if (player:HasSpell(1329)) then + player:LearnSpell(48666) + end +end + + if (intid == 3) then -- Hunter + player:LearnSpell(8737) + player:LearnSpell(1494) + player:LearnSpell(13163) + player:LearnSpell(48996) + player:LearnSpell(49001) + player:LearnSpell(49045) + player:LearnSpell(53338) + player:LearnSpell(5116) + player:LearnSpell(27044) + player:LearnSpell(883) + player:LearnSpell(2641) + player:LearnSpell(6991) + player:LearnSpell(982) + player:LearnSpell(1515) + player:LearnSpell(19883) + player:LearnSpell(20736) + player:LearnSpell(48990) + player:LearnSpell(2974) + player:LearnSpell(6197) + player:LearnSpell(1002) + player:LearnSpell(14327) + player:LearnSpell(5118) + player:LearnSpell(49056) + player:LearnSpell(53339) + player:LearnSpell(49048) + player:LearnSpell(19884) + player:LearnSpell(34074) + player:LearnSpell(781) + player:LearnSpell(14311) + player:LearnSpell(1462) + player:LearnSpell(19885) + player:LearnSpell(19880) + player:LearnSpell(13809) + player:LearnSpell(13161) + player:LearnSpell(5384) + player:LearnSpell(1543) + player:LearnSpell(19878) + player:LearnSpell(49067) + player:LearnSpell(3034) + player:LearnSpell(13159) + player:LearnSpell(19882) + player:LearnSpell(58434) + player:LearnSpell(49071) + player:LearnSpell(49052) + player:LearnSpell(19879) + player:LearnSpell(19263) + player:LearnSpell(19801) + player:LearnSpell(34026) + player:LearnSpell(34600) + player:LearnSpell(34477) + player:LearnSpell(61006) + player:LearnSpell(61847) + player:LearnSpell(53271) + player:LearnSpell(60192) + player:LearnSpell(62757) + + if (player:HasSpell(19386)) then + player:LearnSpell(49012) + end + + if (player:HasSpell(53301)) then + player:LearnSpell(60053) + end + + if (player:HasSpell(19306)) then + player:LearnSpell(48999) + end + + if (player:HasSpell(19434)) then + player:LearnSpell(49050) + end +end + + if (intid == 5) then -- Priest + player:LearnSpell(2053) + player:LearnSpell(48161) + player:LearnSpell(48123) + player:LearnSpell(48125) + player:LearnSpell(48066) + player:LearnSpell(586) + player:LearnSpell(48068) + player:LearnSpell(48127) + player:LearnSpell(48171) + player:LearnSpell(48168) + player:LearnSpell(10890) + player:LearnSpell(6064) + player:LearnSpell(988) + player:LearnSpell(48300) + player:LearnSpell(6346) + player:LearnSpell(48071) + player:LearnSpell(48135) + player:LearnSpell(48078) + player:LearnSpell(453) + player:LearnSpell(9484) + player:LearnSpell(10909) + player:LearnSpell(8129) + player:LearnSpell(48073) + player:LearnSpell(605) + player:LearnSpell(48072) + player:LearnSpell(48169) + player:LearnSpell(552) + player:LearnSpell(1706) + player:LearnSpell(48063) + player:LearnSpell(48162) + player:LearnSpell(48170) + player:LearnSpell(48074) + player:LearnSpell(48158) + player:LearnSpell(48120) + player:LearnSpell(34433) + player:LearnSpell(48113) + player:LearnSpell(32375) + player:LearnSpell(64843) + player:LearnSpell(64901) + player:LearnSpell(53023) + + if (player:HasSpell(34914)) then + player:LearnSpell(48160) + end + + if (player:HasSpell(47540)) then + player:LearnSpell(53007) + end + + if (player:HasSpell(724)) then + player:LearnSpell(48087) + end + + if (player:HasSpell(19236)) then + player:LearnSpell(48173) + end + + if (player:HasSpell(34861)) then + player:LearnSpell(48089) + end + + if (player:HasSpell(15407)) then + player:LearnSpell(48156) + end +end + + if (intid == 8) then --mage + player:LearnSpell(42995) + player:LearnSpell(42833) + player:LearnSpell(27090) + player:LearnSpell(42842) + player:LearnSpell(33717) + player:LearnSpell(42873) + player:LearnSpell(42846) + player:LearnSpell(12826) + player:LearnSpell(28271) + player:LearnSpell(61780) + player:LearnSpell(61721) + player:LearnSpell(28272) + player:LearnSpell(61305) + player:LearnSpell(42917) + player:LearnSpell(43015) + player:LearnSpell(130) + player:LearnSpell(42921) + player:LearnSpell(42926) + player:LearnSpell(43017) + player:LearnSpell(475) + player:LearnSpell(1953) + player:LearnSpell(42940) + player:LearnSpell(12051) + player:LearnSpell(43010) + player:LearnSpell(43020) + player:LearnSpell(43012) + player:LearnSpell(42859) + player:LearnSpell(2139) + player:LearnSpell(42931) + player:LearnSpell(42985) + player:LearnSpell(43008) + player:LearnSpell(45438) + player:LearnSpell(43024) + player:LearnSpell(43002) + player:LearnSpell(43046) + player:LearnSpell(42897) + player:LearnSpell(42914) + player:LearnSpell(66) + player:LearnSpell(58659) + player:LearnSpell(30449) + player:LearnSpell(42956) + player:LearnSpell(47610) + player:LearnSpell(61316) + player:LearnSpell(61024) + player:LearnSpell(55342) + player:LearnSpell(53142) + + if (player:GetTeam() < 1) then + player:LearnSpell(32271) + player:LearnSpell(49359) + player:LearnSpell(3565) + player:LearnSpell(33690) + player:LearnSpell(3562) + player:LearnSpell(3561) + player:LearnSpell(11419) + player:LearnSpell(32266) + player:LearnSpell(11416) + player:LearnSpell(33691) + player:LearnSpell(11059) + player:LearnSpell(49360) + else + player:LearnSpell(3567) + player:LearnSpell(35715) + player:LearnSpell(3566) + player:LearnSpell(49358) + player:LearnSpell(32272) + player:LearnSpell(3563) + player:LearnSpell(11417) + player:LearnSpell(35717) + player:LearnSpell(32267) + player:LearnSpell(49361) + player:LearnSpell(11420) + player:LearnSpell(11418) + end + + if (player:HasSpell(11366)) then + player:LearnSpell(42891) + end + + if (player:HasSpell(11426)) then + player:LearnSpell(43039) + end + + if (player:HasSpell(44457)) then + player:LearnSpell(55360) + end + + if (player:HasSpell(31661)) then + player:LearnSpell(42950) + end + + if (player:HasSpell(11113)) then + player:LearnSpell(42945) + end + + if (player:HasSpell(44425)) then + player:LearnSpell(44781) + end +end + + if (intid == 9) then -- warlock + player:LearnSpell(696) + player:LearnSpell(47811) + player:LearnSpell(47809) + player:LearnSpell(688) + player:LearnSpell(47813) + player:LearnSpell(50511) + player:LearnSpell(57946) + player:LearnSpell(47864) + player:LearnSpell(6215) + player:LearnSpell(47878) + player:LearnSpell(47855) + player:LearnSpell(697) + player:LearnSpell(47856) + player:LearnSpell(47857) + player:LearnSpell(5697) + player:LearnSpell(47884) + player:LearnSpell(47815) + player:LearnSpell(47889) + player:LearnSpell(47820) + player:LearnSpell(698) + player:LearnSpell(712) + player:LearnSpell(126) + player:LearnSpell(5138) + player:LearnSpell(5500) + player:LearnSpell(11719) + player:LearnSpell(132) + player:LearnSpell(60220) + player:LearnSpell(18647) + player:LearnSpell(61191) + player:LearnSpell(47823) + player:LearnSpell(691) + player:LearnSpell(47865) + player:LearnSpell(47891) + player:LearnSpell(47888) + player:LearnSpell(17928) + player:LearnSpell(47860) + player:LearnSpell(47825) + player:LearnSpell(1122) + player:LearnSpell(47867) + player:LearnSpell(18540) + player:LearnSpell(47893) + player:LearnSpell(47838) + player:LearnSpell(29858) + player:LearnSpell(58887) + player:LearnSpell(47836) + player:LearnSpell(61290) + player:LearnSpell(48018) + player:LearnSpell(48020) + player:LearnSpell(33388) + player:LearnSpell (33391) + player:LearnSpell(23161) + + if (player:HasSpell(17877)) then + player:LearnSpell(47827) + end + + if (player:HasSpell(30283)) then + player:LearnSpell(47847) + end + + if (player:HasSpell(30108)) then + player:LearnSpell(47843) + end + + if (player:HasSpell(50796)) then + player:LearnSpell(59172) + end + + if (player:HasSpell(48181)) then + player:LearnSpell(59164) + end + + if (player:HasSpell(18220)) then + player:LearnSpell(59092) + end +end + + if (intid == 7) then --Shaman + player:LearnSpell(8737) + player:LearnSpell(49273) + player:LearnSpell(49238) + player:LearnSpell(10399) + player:LearnSpell(49231) + player:LearnSpell(58753) + player:LearnSpell(2484) + player:LearnSpell(49281) + player:LearnSpell(58582) + player:LearnSpell(49233) + player:LearnSpell(58790) + player:LearnSpell(58704) + player:LearnSpell(58643) + player:LearnSpell(49277) + player:LearnSpell(61657) + player:LearnSpell(8012) + player:LearnSpell(526) + player:LearnSpell(2645) + player:LearnSpell(57994) + player:LearnSpell(8143) + player:LearnSpell(49236) + player:LearnSpell(58796) + player:LearnSpell(58757) + player:LearnSpell(49276) + player:LearnSpell(57960) + player:LearnSpell(131) + player:LearnSpell(58745) + player:LearnSpell(6196) + player:LearnSpell(58734) + player:LearnSpell(58774) + player:LearnSpell(58739) + player:LearnSpell(58656) + player:LearnSpell(546) + player:LearnSpell(556) + player:LearnSpell(66842) + player:LearnSpell(51994) + player:LearnSpell(8177) + player:LearnSpell(58749) + player:LearnSpell(20608) + player:LearnSpell(36936) + player:LearnSpell(58804) + player:LearnSpell(49271) + player:LearnSpell(8512) + player:LearnSpell(6495) + player:LearnSpell(8170) + player:LearnSpell(66843) + player:LearnSpell(55459) + player:LearnSpell(66844) + player:LearnSpell(3738) + player:LearnSpell(2894) + player:LearnSpell(60043) + player:LearnSpell(51514) + + if (player:GetTeam() < 1) then + player:LearnSpell(32182) + else + player:LearnSpell(2825) + end + + if (player:HasSpell(61295)) then + player:LearnSpell(61301) + end + + if (player:HasSpell(974)) then + player:LearnSpell(49284) + end + + if (player:HasSpell(30706)) then + player:LearnSpell(57722) + end + + if (player:HasSpell(51490)) then + player:LearnSpell(59159) + end +end + + if (intid == 6) then + player:LearnSpell(50842) + player:LearnSpell(49941) + player:LearnSpell(49930) + player:LearnSpell(47476) + player:LearnSpell(45529) + player:LearnSpell(3714) + player:LearnSpell(56222) + player:LearnSpell(48743) + player:LearnSpell(48263) + player:LearnSpell(49909) + player:LearnSpell(66188) + player:LearnSpell(47528) + player:LearnSpell(45524) + player:LearnSpell(48792) + player:LearnSpell(57623) + player:LearnSpell(56815) + player:LearnSpell(47568) + player:LearnSpell(49895) + player:LearnSpell(50977) + player:LearnSpell(49576) + player:LearnSpell(49921) + player:LearnSpell(46584) + player:LearnSpell(49938) + player:LearnSpell(48707) + player:LearnSpell(48265) + player:LearnSpell(61999) + player:LearnSpell(42650) + player:LearnSpell(53428) + player:LearnSpell(53331) + player:LearnSpell(54447) + player:LearnSpell(53342) + player:LearnSpell(54446) + player:LearnSpell(53323) + player:LearnSpell(53344) + player:LearnSpell(70164) + player:LearnSpell(62158) + player:LearnSpell(33391) + player:LearnSpell(48778) + player:LearnSpell(51425) + player:LearnSpell(49924) + player:LearnSpell(49924) + + if (player:HasSpell(55050)) then + player:LearnSpell(55262) + end + + if (player:HasSpell(49143)) then + player:LearnSpell(55268) + end + + if (player:HasSpell(49184)) then + player:LearnSpell(51411) + end + + if (player:HasSpell(55090)) then + player:LearnSpell(55271) + end + + if (player:HasSpell(49158)) then + player:LearnSpell(51328) + end +end + + if (intid == 10) then -- Druid + player:LearnSpell(48378) + player:LearnSpell(48469) + player:LearnSpell(48461) + player:LearnSpell(48463) + player:LearnSpell(48441) + player:LearnSpell(53307) + player:LearnSpell(53308) + player:LearnSpell(5487) + player:LearnSpell(48560) + player:LearnSpell(6795) + player:LearnSpell(48480) + player:LearnSpell(53312) + player:LearnSpell(18960) + player:LearnSpell(5229) + player:LearnSpell(48443) + player:LearnSpell(50763) + player:LearnSpell(8983) + player:LearnSpell(8946) + player:LearnSpell(1066) + player:LearnSpell(48562) + player:LearnSpell(783) + player:LearnSpell(770) + player:LearnSpell(16857) + player:LearnSpell(18658) + player:LearnSpell(768) + player:LearnSpell(1082) + player:LearnSpell(16979) + player:LearnSpell(49376) + player:LearnSpell(5215) + player:LearnSpell(48477) + player:LearnSpell(49800) + player:LearnSpell(48465) + player:LearnSpell(48572) + player:LearnSpell(26995) + player:LearnSpell(48574) + player:LearnSpell(2782) + player:LearnSpell(50213) + player:LearnSpell(2893) + player:LearnSpell(33357) + player:LearnSpell(5209) + player:LearnSpell(48575) + player:LearnSpell(48447) + player:LearnSpell(48577) + player:LearnSpell(48579) + player:LearnSpell(5225) + player:LearnSpell(22842) + player:LearnSpell(49803) + player:LearnSpell(9634) + player:LearnSpell(20719) + player:LearnSpell(48467) + player:LearnSpell(29166) + player:LearnSpell(62600) + player:LearnSpell(22812) + player:LearnSpell(48470) + player:LearnSpell(48564) + player:LearnSpell(48566) + player:LearnSpell(33891) + player:LearnSpell(33943) + player:LearnSpell(49802) + player:LearnSpell(48451) + player:LearnSpell(48568) + player:LearnSpell(33786) + player:LearnSpell(40120) + player:LearnSpell(62078) + player:LearnSpell(52610) + player:LearnSpell(50464) + player:LearnSpell(48570) + player:LearnSpell(1850) + if (player:HasSpell(50516)) then + player:LearnSpell(61384) + end + + if (player:HasSpell(48505)) then + -- player:LearnSpell(53201) +player:SendBroadcastMessage("Starfall Rank 4 has been disable due to a damage bug. This Spell will be avaible soon. You can use the Rank 1.") + end + + if (player:HasSpell(48438)) then + player:LearnSpell(53251) + end + + if (player:HasSpell(5570)) then + player:LearnSpell(48468) + end +end + +if (intid == 11) then + player:ResetTalents() + player:SendBroadcastMessage("your talent points are reset.") + player:GossipComplete() +end + +if (intid == 999) then + player:GossipComplete() +end + +if(intid == 99940) then +player:LearnSpell(201) -- One-Handed Swords +player:LearnSpell(202) -- Two-Handed Swords +player:LearnSpell(196) -- One-Handed Axes +player:LearnSpell(197) -- Two-Handed Axes +player:LearnSpell(227) -- Staves +player:LearnSpell(200) -- Polearms +player:LearnSpell(266) -- Guns +player:LearnSpell(264) -- Bows +player:LearnSpell(5011) -- Crossbows +player:LearnSpell(3018) -- Shoot (Bow, Crossbow or Gun) +player:LearnSpell(198) -- One-Handed Maces +player:LearnSpell(199) -- Two-Handed Maces +player:LearnSpell(1180) -- Daggers +player:LearnSpell(2567) -- Thrown +player:LearnSpell(2764) -- Throw (With Thrown) +player:LearnSpell(5009) -- Wands +player:LearnSpell(5019) -- Shoot (Wands) +player:SendBroadcastMessage("Ahora usted tiene todas las habilidades de armas.") -- Message +player:GossipComplete() +end + +if(intid == 99941) then +player:AdvanceSkill (43, 399) +player:AdvanceSkill (44, 399) +player:AdvanceSkill (45, 399) +player:AdvanceSkill (46, 399) +player:AdvanceSkill (54, 399) +player:AdvanceSkill (55, 399) +player:AdvanceSkill (256, 399) +player:AdvanceSkill (160, 399) +player:AdvanceSkill (172, 399) +player:AdvanceSkill (173, 399) +player:AdvanceSkill (176, 399) +player:AdvanceSkill (226, 399) +player:AdvanceSkill (228, 399) +player:AdvanceSkill (229, 399) +player:AdvanceSkill (473, 399) +player:SendBroadcastMessage("He avanzada Todas sus habilidades con armas.!") -- Message +player:GossipComplete() +end + +if(intid == 99942) then +player:LearnSpell(674) -- Dual-Wield +player:SendBroadcastMessage("Ahora usted puede doble empuñadura!") -- Message. +player:GossipComplete() +end + +if(intid == 99943) then +player:LearnSpell(34091) +player:SendBroadcastMessage("has aprendido La Habilidad Artesano! Por favor Relog Para que entre en vigor!") -- Message +player:GossipComplete() +end + +if(intid == 99944) then + player:CastSpell(player, 15366, true) + player:CastSpell(player, 16609, true) + player:CastSpell(player, 48162, true) + player:CastSpell(player, 48074, true) + player:CastSpell(player, 48170, true) + player:CastSpell(player, 43223, true) + player:CastSpell(player, 36880, true) + player:CastSpell(player, 467, true) + player:CastSpell(player, 69994, true) + player:CastSpell(player, 33081, true) + player:CastSpell(player, 24705, true) + player:CastSpell(player, 26035, true) + player:CastSpell(player, 48469, true) + player:SetDisplayId(11657) + player:SetScale(0.8) + player:SendAreaTriggerMessage("|cff00ff00|TInterface\\icons\\spell_holy_fanaticism:30|t|r Estas Buffeado |cffff0000"..player:GetName().."") +player:GossipComplete() +end + +-------Morph--------- +if(intid == 9700) then +player:SetDisplayId(20321) +player:GossipComplete(player) +end +if(intid == 9701) then +player:SetDisplayId(20322) +player:GossipComplete(player) +end +if(intid == 9702) then +player:SetDisplayId(20323) +player:GossipComplete(player) +end +if(intid == 9703) then +player:SetDisplayId(20320) +player:GossipComplete(player) +end +if(intid == 9704) then +player:SetDisplayId(20319) +player:GossipComplete(player) +end +if(intid == 9705) then +player:SetDisplayId(20318) +player:GossipComplete(player) +end +if(intid == 9706) then +player:SetDisplayId(20317) +player:GossipComplete(player) +end +if(intid == 9707) then +player:SetDisplayId(20316) +player:GossipComplete(player) +end +end + +RegisterCreatureGossipEvent(UnitEntry, 1, Trainers_Gossip) +RegisterCreatureGossipEvent(UnitEntry, 2, Menu_Trainers_Select) \ No newline at end of file diff --git a/gms.lua b/gms.lua new file mode 100644 index 0000000..65fe44e --- /dev/null +++ b/gms.lua @@ -0,0 +1,28 @@ + +-- idea by 125125 +-- code by slp13at420 +local GM_Gear = {{2586,1},{11508,1},{12064,1},{17,1},{192,1},{23162,4},}; -- {item id, count} -- Robe x1, Slippers x1, Hood x1, Martins Fury x1, Martins Staff x1, Foror's Crate of Endless Tears x4 + +function GM_gearme(event, player, message, type, language) + + if(message == "#gmgearme")then + + if(player:GetGMRank()>=1)then + + for a=1, #GM_Gear do + + if(player:GetItemCount(GM_Gear[a][1]) < GM_Gear[a][2])then + + for b=1, GM_Gear[a][2] do + + player:AddItem(GM_Gear[a][1], 1) + end + else + player:SendBroadcastMessage("You have "..GM_Gear[a][2].." "..GetItemLink(GM_Gear[a][1])..".") + end + end + end + end +end + +RegisterPlayerEvent(18, GM_gearme) \ No newline at end of file diff --git a/premium.lua b/premium.lua new file mode 100644 index 0000000..8eb9cd4 --- /dev/null +++ b/premium.lua @@ -0,0 +1,47 @@ +-- NOTE: need to insert character_premium.sql in your characters database + +local function PremiumOnLogin(event, player) -- Send a welcome massage to player and tell him is premium or not + local result = CharDBQuery("SELECT AccountId FROM premium WHERE active=1 and AccountId = "..player:GetAccountId()) + if (result) then + player:SendBroadcastMessage("|CFFE55BB0[Premium]|r|CFFFE8A0E Welcome "..player:GetName().." you are Premium! |r") + else + player:SendBroadcastMessage("|CFFE55BB0[Premium]|r|CFFFE8A0E Welcome "..player:GetName().." you are NOT Premium! |r") + end +end + +local function PremiumOnChat(event, player, msg, _, lang) + local result = CharDBQuery("SELECT AccountId FROM premium WHERE active=1 and AccountId = "..player:GetAccountId()) + if (msg == "#premium") then -- Use #premium for sending the gossip menu + if (result) then + OnPremiumHello(event, player) + else + player:SendBroadcastMessage("|CFFE55BB0[Premium]|r|CFFFE8A0E Sorry "..player:GetName().." you are NOT Premium! |r") + end + end +end + +function OnPremiumHello(event, player) + player:GossipClearMenu() + player:GossipMenuAddItem(0, "Show Bank", 0, 3) + player:GossipMenuAddItem(0, "Show AuctionsHouse", 0, 4) + player:GossipMenuAddItem(0, "Nevermind..", 0, 1) + -- Room for more premium things + player:GossipSendMenu(1, player, 100) +end + +function OnPremiumSelect(event, player, _, sender, intid, code) + if (intid == 1) then -- Close the Gossip + player:GossipComplete() + elseif (intid == 2) then -- Go back to main menu + OnPremiumHello(event, player) + elseif (intid == 3) then -- Send Bank Window + player:SendShowBank(player) + elseif (intid == 4) then -- Send Auctions Window + player:SendAuctionMenu(player) + end + -- Room for more premium things +end + +RegisterPlayerEvent(3, PremiumOnLogin) -- Register Event On Login +RegisterPlayerEvent(18, PremiumOnChat) -- Register Evenet on Chat Command use +RegisterPlayerGossipEvent(100, 2, OnPremiumSelect) -- Register Event for Gossip Select \ No newline at end of file diff --git a/reglas.lua b/reglas.lua new file mode 100644 index 0000000..8a6a588 --- /dev/null +++ b/reglas.lua @@ -0,0 +1,120 @@ +--[==[ + NOTE: need to insert character_rules.sql in your characters database +]==] + +-- Include sc_default +require "sc_default" + + +local RulesSystem = {} + +-- Rules Settings +RulesSystem.Settings = { + Name = "|cffff0000[Rules System]|r", + Cooldown = 30, + Spell = 9454, +}; + +-- Rules Texts +RulesSystem.Texts = { + [0] = "|CFFFF0303Server Rules!|r", + [1] = "|CFFFFFF01Welcome on CoronaCore Server|r", + [2] = "TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT", + [3] = "|CFFFF0303Server Infos!|r", + [4] = "TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT TEXT", + [5] = "|CFFFFFF01http://your-server.com|r", +}; + +-- Commands for Rules +RulesSystem.Commands = { + [0] = "#rules", -- Show rules + [1] = "#rules reset", -- Reset Rules for all Player (Only GameMaster can use it) + [2] = "#rules send all", -- Send Rules Window to all Online Players + [3] = "#rules send player", -- Send Rules Window to player %s +}; + +if (RulesSystem.Commands[3]:sub(-1) ~= " ") then + RulesSystem.Commands[3] = RulesSystem.Commands[3].." "; +end + +function RulesSystem.OnChat(event, player, msg, _, lang) -- Use "#rules" for sending rules + if (msg == RulesSystem.Commands[0]) then + RulesSystem.OnGossipHello(event, player) + return false; + elseif (msg == RulesSystem.Commands[1]) and player:IsGM() == true then + CharDBQuery("UPDATE character_rules SET active = 1") + player:SendBroadcastMessage(string.format("%s Rules update please accept again!", RulesSystem.Settings.Name)) + return false; + elseif (msg == RulesSystem.Commands[2]) and player:IsGM() == true then + for _, p in ipairs(GetPlayersInWorld()) do + RulesSystem.OnGossipHello(event, p) + end + return false; + elseif (msg:sub(1, RulesSystem.Commands[3]:len()) == RulesSystem.Commands[3]) and player:IsGM() == true then + if GetPlayerByName(msg:sub(RulesSystem.Commands[3]:len()+1)) then + RulesSystem.OnGossipHello(event, GetPlayerByName(msg:sub(RulesSystem.Commands[3]:len()+1))) + else + player:SendBroadcastMessage(string.format("%s No player found with name %s", RulesSystem.Settings.Name, msg:sub(RulesSystem.Commands[3]:len()+1))) + end + return false; + end +end + +function RulesSystem.OnCharCreate(event, player) -- Insert guid into character_rules on new character create + CharDBQuery(string.format("INSERT INTO character_rules (`guid`) VALUES (%s)", player:GetGUIDLow())) +end + +function RulesSystem.OnCharDelete(event, player) -- Delete guid from character_rules on character delete + CharDBQuery(string.format("DELETE FROM character_rules WHERE guid = (%s)", player)) +end + +function RulesSystem.OnLogin(event, player) + local RulesActive = CharDBQuery(string.format("SELECT * FROM character_rules WHERE active = 1 and guid = (%s)", player:GetGUIDLow())) + local PlayerName = player:GetName() + + if RulesActive then -- Check Rules Active on Login + player:AddAura(RulesSystem.Settings.Spell, player) -- AddAura frozen to Player + player:PlaySoundToPlayer(1509) + player:SendBroadcastMessage(string.format("%s Welcome %s please read the rules and accept it, use #rules to watch the rules again!", RulesSystem.Settings.Name, PlayerName, RulesCommand)) + player:SetLuaCooldown(RulesSystem.Settings.Cooldown, 2) + player:RegisterEvent(RulesSystem.CooldownCheck, 1000, player:GetLuaCooldown(2)) + end +end + +function RulesSystem.OnGossipHello(event, player) -- Show Rules + player:GossipClearMenu() + player:GossipMenuAddItem(4, "", 0, 1, false, string.format("%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n", RulesSystem.Texts[0], RulesSystem.Texts[1], RulesSystem.Texts[2], RulesSystem.Texts[3], RulesSystem.Texts[4], RulesSystem.Texts[5], RulesSystem.Texts[5])) + player:GossipSendMenu(0x7FFFFFFF, player, 100) +end + +function RulesSystem.OnGossipSelect(event, player, _, sender, intid, code) + local PlayerName = player:GetName() + + if (intid == 1) and player:GetLuaCooldown(2) == 0 then + player:RemoveAura(RulesSystem.Settings.Spell) -- Remove Aura + CharDBQuery(string.format("UPDATE character_rules SET active = 0 WHERE guid = (%s)", player:GetGUIDLow())) + player:SendBroadcastMessage(string.format("%s Thank you %s that they have read the rules and accepted!", RulesSystem.Settings.Name, PlayerName)) + player:PlaySoundToPlayer(888) + player:GossipComplete() -- Close the Gossip + end +end + +function RulesSystem.CooldownCheck(event, delay, repeats, player) + local PlayerName = player:GetName() + + if player:GetLuaCooldown(2) > 0 then + player:GossipClearMenu() + player:GossipMenuAddItem(4, "", 0, 1, false, string.format("%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n%s\n\n|cffff0000You can accept in |CFFFFFF01%s|r |cffff0000seconds|r\n\n", RulesSystem.Texts[0], RulesSystem.Texts[1], RulesSystem.Texts[2], RulesSystem.Texts[3], RulesSystem.Texts[4], RulesSystem.Texts[5], math.ceil(player:GetLuaCooldown(2)))) + player:GossipSendMenu(0x7FFFFFFF, player, 100) + else + RulesSystem.OnGossipHello(event, player) + player:PlaySoundToPlayer(1150) + player:RemoveEvents() + end +end + +RegisterPlayerEvent(1, RulesSystem.OnCharCreate) -- Register Evenet On Character Create +RegisterPlayerEvent(2, RulesSystem.OnCharDelete) -- Register Evenet On Character Create +RegisterPlayerEvent(3, RulesSystem.OnLogin) -- Register Event On Login +RegisterPlayerGossipEvent(100, 2, RulesSystem.OnGossipSelect) -- Register Event for Gossip Select +RegisterPlayerEvent(18, RulesSystem.OnChat) -- Register Evenet on Chat Command use \ No newline at end of file diff --git a/resent_talents.lua b/resent_talents.lua new file mode 100644 index 0000000..a3463c9 --- /dev/null +++ b/resent_talents.lua @@ -0,0 +1,28 @@ +function Resettalents(event, player, msg) +local VIP = AuthDBQuery("SELECT `vip` FROM `account` WHERE `id`='"..player:GetAccountId().."'") +VIP = VIP:GetUInt32(0) --pls add an intiger (11) field with name "vip" to youre account table. +local name = player:GetName() +if(VIP == 1)then +SendWorldMessage("|cff00ff00VIP1|R:{|cffff6060"..name.."|R} Reset his/her talents And got |cffff6060 5|R more talents.") +end +if(VIP == 2)then +SendWorldMessage("|cff00ff00VIP2|R:{|cffff6060"..name.."|R} Reset his/her talents And got |cffff6060 10|R more talents.") +end +if(VIP == 3)then +SendWorldMessage("|cff00ff00VIP3|R:{|cffff6060"..name.."|R} Reset his/her talents And got |cffff6060 15|R more talents.") +end +if(VIP == 4)then +SendWorldMessage("|cff00ff00VIP4|R:{|cffff6060"..name.."|R} Reset his/her talents And got |cffff6060 20|R more talents.") +end +if(VIP == 5)then +SendWorldMessage("|cff00ff00VIP5|R:{|cffff6060"..name.."|R} Reset his/her talents And got |cffff6060 25|R more talents.") +end +if(VIP == 6)then +SendWorldMessage("|cff00ff00VIP6|R:{|cffff6060"..name.."|R} Reset his/her talents And got |cffff6060 30|R more talents.") +end +if(VIP == 7)then +SendWorldMessage("|cff00ff00VIP7|R:{|cffff6060"..name.."|R} Reset his/her talents And got |cffff6060 35|R more talents.") +end +end + +RegisterPlayerEvent( 17, Resettalents) \ No newline at end of file diff --git a/restringir_zona.lua b/restringir_zona.lua new file mode 100644 index 0000000..2ba3bb5 --- /dev/null +++ b/restringir_zona.lua @@ -0,0 +1,27 @@ +local ZoneCheck = { + AllowedZones = { + [4] = true, + [2037] = true, + [3277] = true, + [2597] = true, + [3358] = true, + }, + TeleportLocations = { + -- [TeamId] = {Map, X, Y, Z, Orientation} + [0] = {0, -10998, -3400, 62.5, 0}, + [1] = {0, -10900, -2700, 7.6, 0}, + }, + RestrictedMessage = "You have entered a restricted zone. You have been removed from the area." +} + +function ZoneCheck.OnChange(event, player, newZone) + if not player:IsGM() then + if not(ZoneCheck.AllowedZones[newZone]) then + local map, x, y, z, o = table.unpack(ZoneCheck.TeleportLocations[player:GetTeam()]) + player:Teleport(map, x, y, z, o) + player:SendAreaTriggerMessage(ZoneCheck.RestrictedMessage) + end + end +end + +RegisterPlayerEvent(27, ZoneCheck.OnChange) \ No newline at end of file diff --git a/runchat#.lua b/runchat#.lua new file mode 100644 index 0000000..6298d77 --- /dev/null +++ b/runchat#.lua @@ -0,0 +1,22 @@ +function CMD_Handler( event, player, msg ) + if (player:GetGMRank() >= 1) and string.sub(msg, 1, 1) == "#" then + local chunk, errors = load(string.sub(msg, 2, msg:len())) + + if errors then + print(errors) + player:SendBroadcastMessage("[ERROR]: "..errors) + else + Player = player or nil + Target = player:GetSelection() or nil + xpcall(chunk, function(ok, errors) print(ok, errors) end) + end + + return false + end +end + +RegisterPlayerEvent(18, CMD_Handler) +RegisterPlayerEvent(19, CMD_Handler) +RegisterPlayerEvent(20, CMD_Handler) +RegisterPlayerEvent(21, CMD_Handler) +RegisterPlayerEvent(22, CMD_Handler) diff --git a/sc_default.lua b/sc_default.lua new file mode 100644 index 0000000..023e9ce --- /dev/null +++ b/sc_default.lua @@ -0,0 +1,164 @@ +-- +-- Cooldown Methods by Foereaper +-- +-- player:SetLuaCooldown(seconds[, opt_id]) -- Sets the cooldown timer to X seconds, optionally a specific cooldown ID can be set. Default ID: 1 +-- player:GetLuaCooldown([opt_id]) -- Returns cooldown or 0 if none, default cooldown checked is ID 1, unless other is specified. +-- + +local cooldowns = {}; + +function Player:SetLuaCooldown(seconds, opt_id) + assert(type(self) == "userdata"); + seconds = assert(tonumber(seconds)); + opt_id = opt_id or 1; + local guid = self:GetGUIDLow(); + + if (not cooldowns[guid]) then + cooldowns[guid] = {}; + end + + cooldowns[guid][opt_id] = os.time() + seconds; +end + +function Player:GetLuaCooldown(opt_id) + assert(type(self) == "userdata"); + local guid = self:GetGUIDLow(); + opt_id = opt_id or 1; + + if (not cooldowns[guid]) then + cooldowns[guid] = {}; + end + + local cd = cooldowns[guid][opt_id]; + if (not cd or cd < os.time()) then + cooldowns[guid][opt_id] = 0 + return 0; + else + return cooldowns[guid][opt_id] - os.time(); + end +end + +-- +-- GossipSetText Methods by Rochet2 +-- +-- player:GossipMenuAddItem(0, "Text", 0, 0) +-- player:GossipMenuAddItem(0, "Text", 0, 0) +-- player:GossipSetText("Text") +-- player:GossipSendMenu(0x7FFFFFFF, creature) +-- + +local SMSG_NPC_TEXT_UPDATE = 384 +local MAX_GOSSIP_TEXT_OPTIONS = 8 + +function Player:GossipSetText(text) + data = CreatePacket(SMSG_NPC_TEXT_UPDATE, 100); + data:WriteULong(0x7FFFFFFF) + for i = 1, MAX_GOSSIP_TEXT_OPTIONS do + data:WriteFloat(0) -- Probability + data:WriteString(text) -- Text + data:WriteString(text) -- Text + data:WriteULong(0) -- language + data:WriteULong(0) -- emote + data:WriteULong(0) -- emote + data:WriteULong(0) -- emote + data:WriteULong(0) -- emote + data:WriteULong(0) -- emote + data:WriteULong(0) -- emote + end + self:SendPacket(data) +end + +-- +-- WorldState methods by Foereaper +-- +-- player:InitializeWorldState(Map, Zone, StateID, Value) +-- player:UpdateWorldState(StateID, Value) +-- + +local SMSG_INIT_WORLD_STATES = 0x2C2 +local SMSG_UPDATE_WORLD_STATE = 0x2C3 + +function Player:InitializeWorldState(Map, Zone, StateID, Value) + local data = CreatePacket(SMSG_INIT_WORLD_STATES, 18); + data:WriteULong(Map); + data:WriteULong(Zone); + data:WriteULong(0); + data:WriteUShort(1); + data:WriteULong(StateID); + data:WriteULong(Value); + self:SendPacket(data) +end + +function Player:UpdateWorldState(StateID, Value) + local data = CreatePacket(SMSG_UPDATE_WORLD_STATE, 8); + data:WriteULong(StateID); + data:WriteULong(Value); + self:SendPacket(data) +end + +function ChatMsg(type) + if (type == 0x00) then + return("System") + elseif (type == 0x01) then + return("Says") + elseif (type == 0x02) then + return("Party") + elseif (type == 0x03) then + return("Raid") + elseif (type == 0x04) then + return("Guild["..pg.."]") + elseif (type == 0x05) then + return("Guild Officer["..pg.."]") + elseif (type == 0x06) then + return("Yells") + elseif (type == 0x07) then + return("Whisper") + elseif (type == 0x11) then + return("(General/Trade/Local Defense/LFG/Custom)") + elseif (type == 0x2C) then + return("Battleground") + elseif (type == 0x2D) then + return("Battleground Leader") + else + return(type) + end +end + +function CreateQueue() + local Queue = {Queue = {}} + + function Queue:Set(index) + if (self:Has(index)) then + return false + end + self.Queue[index] = true + return true + end + + function Queue:Remove(index) + if (not self:Has(index)) then + return false + end + self.Queue[index] = nil + return true + end + + function Queue:Has(index) + return self.Queue[index] ~= nil + end + + function Queue:Get() + return self.Queue + end + + local pairs = pairs + function Queue:Count() + local count = 0 + for k,v in pairs(self.Queue) do + count = count + 1 + end + return count + end + + return Queue +end \ No newline at end of file diff --git a/spells_en_leveo.lua b/spells_en_leveo.lua new file mode 100644 index 0000000..fce9a12 --- /dev/null +++ b/spells_en_leveo.lua @@ -0,0 +1,539 @@ +--[[ + Do not repost without my permission. + Do not take credits for what you haven't scripted. + I hope you like this script. + If you like my scripts feel free to request one. +------------------------------------------------------ + - Developer(s): µDev, Jafferwaffer, Foereaper, slp13at420, + Grandelf + - Thanks to: Eluna Devs + - Complete: %100 + - ScriptName: 'LearnSpellOnLevelUp' + - Comment: Please contact me if you find any missing spell. +------------------------------------------------------ + Updated : 20/10/15 by Jafferwaffer + Working + Tested with latest TC with Eluna 3.3.5a + + A collabrative effort by all Devs listed. Original by + µDev. Updated + made more efficient by rest of us. + Post on EmuDevs forum for support. + +]] + +local Classes = { + ["Warrior"] = { + [2] = {6673}, + [3] = {100}, + [4] = {772}, + [6] = {6343, 34428}, + [8] = {1715, 284}, + [10] = {6546, 2687}, + [12] = {7384, 5242, 72}, + [14] = {1160, 6572}, + [16] = {285, 694, 2565}, + [18] = {8198, 676}, + [20] = {6547, 20230, 845, 12678}, + [22] = {6192, 5246}, + [24] = {1608, 6190, 5308, 6574}, + [26] = {6178, 1161}, + [28] = {8204, 871}, + [30] = {6548, 7369, 20252, 1464}, + [32] = {11564, 11549, 18499, 20658}, + [34] = {11554, 7379}, + [36] = {1680}, + [38] = {8205, 6552, 8820}, + [40] = {11565, 11572, 11608, 20660, 23922}, + [42] = {11550}, + [44] = {11555, 11600}, + [46] = {11578, 11604}, + [48] = {11566, 11580, 20661, 23923}, + [50] = {11573, 11609, 1719}, + [52] = {11551}, + [54] = {11556, 11605, 11601, 23924}, + [56] = {11567, 20662}, + [58] = {11581}, + [60] = {25286, 11574, 25289, 20569, 25288, 23925}, + [61] = {25241}, + [62] = {25202}, + [63] = {25269}, + [64] = {23920}, + [65] = {25234}, + [66] = {29707, 25258}, + [67] = {25264}, + [68] = {25208, 25231, 469}, + [69] = {2048, 25242}, + [70] = {30324, 25203, 25236, 3411, 30357}, + [71] = {46845, 64382}, + [72] = {47449, 47519}, + [73] = {47501, 47470}, + [74] = {47439, 47474}, + [75] = {55694, 47487}, + [76] = {47450, 47465}, + [77] = {47520}, + [78] = {47502, 47436}, + [79] = {47437, 47475}, + [80] = {57755, 47440, 47471, 57823, 47488}, + }, + ["Paladin"] = { + [4] = {465, 19740, 20271}, + [6] = {639, 498}, + [8] = {1152, 853}, + [10] = {633, 10290, 1022}, + [12] = {19834, 53408}, + [14] = {19742, 647, 31789}, + [16] = {62124, 25780, 7294}, + [18] = {1044}, + [20] = {26573, 879, 19750, 5502, 20217, 643}, + [22] = {19746, 1026, 20164, 19835}, + [24] = {19850, 10322, 10326, 5588, 5599}, + [26] = {19939, 1038, 10298}, + [28] = {5614, 19876, 53407}, + [30] = {20116, 1042, 2800, 20165, 10291, 19752}, + [32] = {19888, 19836}, + [34] = {19852, 19940, 642}, + [36] = {5615, 10324, 19891, 10299}, + [38] = {3472, 20166, 10278}, + [40] = {20922, 1032, 5589, 19895}, + [42] = {4987, 19941, 19837}, + [44] = {19853, 10312, 19897, 24275}, + [46] = {10328, 6940, 10300}, + [48] = {20772, 19899}, + [50] = {20923, 19942, 2812, 10310, 10292}, + [52] = {10313, 19896, 19838, 25782, 24274}, + [54] = {19854, 25894, 10329, 10308}, + [56] = {19898, 10301}, + [58] = {19943}, + [60] = {25290, 20924, 10314, 25918, 25292, 10318, 20773, 10293, 19900, 25898, 25899, 25291, 25916, 24239}, + [62] = {27135, 32223}, + [63] = {27151}, + [65] = {27142, 27143}, + [66] = {27137, 27150}, + [68] = {27138, 27152, 27180}, + [69] = {27139, 27154}, + [70] = {27173, 27136, 27149, 27153, 27140, 27141, 31884}, + [71] = {48935, 54428, 48937}, + [72] = {48816, 48949}, + [73] = {48800, 48931, 48933}, + [74] = {48784, 48941, 48805}, + [75] = {48818, 48781, 53600}, + [76] = {48943, 54043}, + [77] = {48936, 48938, 48945}, + [78] = {48817, 48788, 48947}, + [79] = {48801, 48785, 48950, 48942, 48932, 48934}, + [80] = {48819, 48782, 53601, 61411, 48806}, + }, + ["Hunter"] = { + [2] = {1494}, + [4] = {13163, 1978}, + [6] = {3044, 1130}, + [8] = {5116, 14260}, + [10] = {13165, 13549, 19883}, + [12] = {136, 14281, 20736, 2974}, + [14] = {6197, 1002, 1513}, + [16] = {5118, 13795, 1495, 14261}, + [18] = {14318, 2643, 13550, 19884}, + [20] = {34074, 3111, 674, 14282, 781, 1499}, + [22] = {14323, 3043}, + [24] = {1462, 14262, 19885}, + [26] = {19880, 14302, 13551, 3045}, + [28] = {14319, 3661, 14283, 13809}, + [30] = {13161, 14326, 14288, 5384, 14269}, + [32] = {1543, 14263, 19878}, + [34] = {13552, 13813}, + [36] = {3662, 14284, 3034, 14303}, + [38] = {14320}, + [40] = {13159, 14324, 1510, 14310, 14264, 19882}, + [42] = {14289, 13553}, + [44] = {13542, 14285, 14316, 14270}, + [46] = {20043, 14327, 14304}, + [48] = {14321, 14265}, + [50] = {13554, 56641, 14294, 19879}, + [52] = {13543, 14286}, + [54] = {14290, 14317}, + [56] = {20190, 14305, 14266}, + [58] = {14322, 14325, 13555, 14295, 14271}, + [60] = {25296, 13544, 14287, 25294, 25295, 19801, 19263, 14311}, + [61] = {27025}, + [62] = {34120}, + [63] = {27014}, + [65] = {27023}, + [66] = {34026}, + [67] = {27021, 27016, 27022}, + [68] = {27044, 27045, 27046, 34600}, + [69] = {27019}, + [70] = {34477, 36916}, + [71] = {53351, 49051, 49066, 48995}, + [72] = {49055}, + [73] = {49044, 49000}, + [74] = {61846, 48989, 49047, 58431}, + [75] = {53271, 61005}, + [76] = {49071, 53338}, + [77] = {49052, 49067, 48996}, + [78] = {49056}, + [79] = {49045, 49001}, + [80] = {61847, 62757, 48990, 61006, 49048, 58434, 60192, 53339}, + }, + ["Rogue"] = { + [1] = {1784, 3127}, + [4] = {53, 921}, + [6] = {1776, 1757}, + [8] = {6760, 5277}, + [10] = {5171, 2983, 6770}, + [12] = {2589, 1766}, + [14] = {8647, 703, 1758}, + [16] = {6761, 1966, 1804}, + [18] = {8676}, + [20] = {51722, 1943, 2590}, + [22] = {8631, 1759, 1725, 1856}, + [24] = {6762, 2836}, + [26] = {8724, 1833}, + [28] = {8639, 2591, 6768, 2070}, + [30] = {8632, 408, 1760, 1842}, + [32] = {8623}, + [34] = {8725, 8696, 2094}, + [36] = {8640, 8721}, + [38] = {8633, 8621}, + [40] = {8624, 8637, 1860}, + [42] = {11267, 6774, 1857}, + [44] = {11273, 11279}, + [46] = {11289, 11293}, + [48] = {11299, 11297}, + [50] = {11268, 8643, 26669}, + [52] = {11274, 11280, 11303}, + [54] = {11290, 11294}, + [56] = {11300}, + [58] = {11269, 11305}, + [60] = {31016, 11275, 11281, 25300, 25302}, + [61] = {26839}, + [62] = {32645, 26861, 26889}, + [64] = {26679, 26865, 27448}, + [66] = {27441, 31224}, + [68] = {26867, 26863}, + [69] = {32684}, + [70] = {48689, 48673, 26884, 5938, 26862}, + [71] = {51724}, + [72] = {48658}, + [73] = {48667}, + [74] = {57992, 48671, 48656}, + [75] = {48690, 48675, 57934}, + [76] = {48674, 48637}, + [78] = {48659}, + [79] = {48668, 48672}, + [80] = {48691, 57993, 48676, 48657, 51723, 48638}, + }, + ["Priest"] = { + [1] = {1243}, + [4] = {2052, 589}, + [6] = {17, 591}, + [8] = {139, 586}, + [10] = {2053, 2006, 8092, 594}, + [12] = {588, 1244, 592}, + [14] = {528, 6074, 598, 8122}, + [16] = {2054, 8102}, + [18] = {527, 600, 970}, + [20] = {6346, 7128, 9484, 2061, 14914, 15237, 6075, 2944, 453}, + [22] = {2055, 2010, 984, 8103, 2096}, + [24] = {8129, 1245, 3747, 15262}, + [26] = {9472, 6076, 992}, + [28] = {6063, 15430, 19276, 8104, 8124}, + [30] = {14752, 602, 6065, 15263, 596, 1004, 605, 976}, + [32] = {552, 9473, 6077}, + [34] = {1706, 6064, 10880, 8105, 2767}, + [36] = {988, 2791, 6066, 15264, 15431, 19277}, + [38] = {9474, 6078, 6060}, + [40] = {14818, 1006, 9485, 2060, 996, 8106}, + [42] = {10898, 15265, 10888, 10957, 10892}, + [44] = {10915, 27799, 10927, 19278, 10909}, + [46] = {10963, 10881, 10933, 10945}, + [48] = {10937, 10899, 21562, 15266}, + [50] = {14819, 10951, 10916, 10960, 10928, 10893}, + [52] = {10964, 27800, 19279, 10946}, + [54] = {10900, 15267, 10934}, + [56] = {10917, 10929, 27683, 10890, 10958}, + [58] = {10965, 20770, 10947, 10894}, + [60] = {27841, 10952, 10938, 10901, 21564, 27681, 10955, 25314, 15261, 27801, 10961, 25316, 25315, 19280}, + [61] = {25233, 25363}, + [62] = {32379}, + [63] = {25210, 25372}, + [64] = {32546}, + [65] = {25217, 25221, 25367}, + [66] = {25384, 34433}, + [67] = {25235}, + [68] = {25213, 25331, 25308, 33076, 25435, 25467, 25433}, + [69] = {25431, 25364, 25375}, + [70] = {25312, 32375, 25389, 25218, 25392, 32999, 25222, 39374, 32996, 25368}, + [71] = {48040}, + [72] = {48119, 48134}, + [73] = {48070, 48062, 48299}, + [74] = {48112, 48122, 48126}, + [75] = {48065, 48077, 48067, 48045, 48157, 48124}, + [76] = {48072, 48169}, + [77] = {48168, 48170}, + [78] = {48120, 48063, 48135, 48171}, + [79] = {48071, 48113, 48123, 48300, 48127}, + [80] = {48073, 48161, 48066, 48162, 48074, 64843, 48078, 64901, 48068, 53023, 48158, 48125}, + }, + ["Death Knight"] = { + [56] = {50842, 49998, 46584}, + [57] = {48263, 47528}, + [58] = {48721, 45524}, + [59] = {49926, 47476}, + [60] = {43265, 49917}, + [61] = {49896, 49020, 3714}, + [62] = {48792, 49892}, + [63] = {49999}, + [64] = {49927, 45529}, + [65] = {56222, 57330, 49918}, + [66] = {49939, 48743}, + [67] = {49903, 51423, 56815, 49936}, + [68] = {48707, 49893}, + [69] = {49928}, + [70] = {45463, 49919, 48265}, + [72] = {49940, 61999}, + [73] = {49904, 51424, 49937}, + [74] = {49929}, + [75] = {47568, 57623, 49923, 49920}, + [76] = {49894}, + [78] = {49941, 49909}, + [79] = {51425}, + [80] = {49930, 42650, 49938, 49895, 49924, 49921}, + }, + ["Shaman"] = { + [2] = {8017}, + [4] = {8042}, + [6] = {2484, 332}, + [8] = {8044, 529, 5730, 324, 8018}, + [10] = {8050, 8024, 8075}, + [12] = {1535, 370, 2008, 547}, + [14] = {8045, 548}, + [16] = {57994, 2645, 325, 8019, 526}, + [18] = {8052, 6390, 8027, 913, 8143}, + [20] = {8056, 915, 8033, 8004, 52127,5394}, + [22] = {8498, 131}, + [24] = {8046, 8181, 905, 10399, 8160, 20609, 939}, + [26] = {943, 8190, 6196, 8030, 5675}, + [28] = {8053, 6391, 8184, 8227, 8038, 546, 8008, 52129}, + [30] = {66842, 556, 8177, 10595, 8232, 51730, 6375, 20608, 36936}, + [32] = {421, 8499, 6041, 8012, 945, 8512, 959}, + [34] = {8058, 6495, 52131}, + [36] = {10412, 10585, 16339, 20610, 8010, 10495}, + [38] = {10391, 6392, 8249, 10478, 10456, 8161, 8170}, + [40] = {66843, 930, 10447, 8134, 8235, 1064, 51988, 6377, 8005}, + [41] = {52134}, + [42] = {11314, 10537}, + [44] = {10392, 10600, 10466}, + [46] = {10472, 10586, 16341, 10622, 10496}, + [48] = {2860, 10413, 10427, 10526, 16355, 10431, 20776, 10395, 52136}, + [50] = {66844, 15207, 10486, 51991, 10462}, + [52] = {11315, 10448, 10442, 10467}, + [54] = {10479, 10623}, + [55] = {52138}, + [56] = {10605, 15208, 10587, 16342, 10432, 10396, 10497}, + [58] = {10473, 10428, 10538, 16387, 16356}, + [60] = {10414, 29228, 10601, 25361, 16362, 20777, 51992, 10463, 25357, 10468}, + [61] = {25546, 25422}, + [62] = {25448, 24398}, + [63] = {25439, 25469, 25391}, + [64] = {25489, 3738}, + [65] = {25552, 25528, 25570}, + [66] = {2062, 25500, 25420}, + [67] = {25449, 25525, 25557, 25560}, + [68] = {2894, 25464, 25563, 25505, 25423}, + [69] = {25454, 25574, 25590, 25567, 33736}, + [70] = {25442, 25547, 25457, 25472, 51993, 25396}, + [71] = {58580, 58649, 58785, 58794, 58801, 58755, 58771}, + [72] = {49275}, + [73] = {49235, 49237, 58731}, + [74] = {49270, 49230, 55458}, + [75] = {61649, 49232, 51505, 58581, 58737, 58652, 58741, 49280, 58746, 57622, 49272}, + [76] = {58789, 58795, 58803, 58756, 58773, 57960}, + [77] = {49276}, + [78] = {49236, 58734, 58582}, + [79] = {49231, 49238}, + [80] = {49271, 61657, 49233, 51514, 60043, 58739, 58656, 58790, 58745, 58796, 49281, 58749, 58643, 58804, 49277, 55459, 51994, 58757, 49273, 58774}, + }, + ["Mage"] = { + [2] = {1459}, + [4] = {5504, 116}, + [6] = {587, 2136, 143}, + [8] = {5143, 118, 205}, + [10] = {5505, 7300, 122}, + [12] = {597, 604, 130, 145}, + [14] = {1449, 1460, 2137, 837}, + [16] = {5144, 2120}, + [18] = {1008, 475, 3140}, + [20] = {1953, 5506, 12051, 1463, 12824, 543, 10, 7301, 7322}, + [22] = {8437, 990, 2138, 2948, 6143}, + [24] = {5145, 2139, 8450, 8400, 2121}, + [26] = {120, 865, 8406}, + [28] = {1461, 759, 8494, 8444, 6141}, + [30] = {8455, 8438, 6127, 8412, 8457, 8401, 7302, 45438}, + [32] = {8416, 6129, 8422, 8461, 8407}, + [34] = {6117, 8445, 8492}, + [36] = {8451, 8495, 8402, 8427}, + [38] = {8439, 3552, 8413, 8408}, + [40] = {8417, 10138, 12825, 8458, 8423, 8446, 6131, 7320}, + [42] = {10169, 10156, 10144, 10148, 10159, 8462}, + [44] = {10191, 10185, 10179}, + [46] = {10201, 22782, 10197, 10205}, + [48] = {10211, 10053, 10173, 10149, 10215}, + [50] = {10139, 10223, 10160, 10180, 10219}, + [52] = {10145, 10192, 10206, 10186, 10177}, + [54] = {10170, 10202, 10199, 10150, 10230}, + [56] = {23028, 10157, 10212, 10216, 10181}, + [58] = {10054, 22783, 10207, 10161}, + [60] = {25345, 28612, 10140, 10174, 10193, 12826, 10225, 10151, 10187, 28609, 25304, 10220}, + [61] = {27078}, + [62] = {27080, 25306, 30482}, + [63] = {27130, 27075, 27071}, + [64] = {30451, 27086}, + [65] = {37420, 27073, 27087}, + [66] = {27070, 30455}, + [67] = {33944, 27088}, + [68] = {27101, 66, 27131, 27085}, + [69] = {33946, 38699, 27125, 27128, 27072, 27124}, + [70] = {27127, 27082, 27126, 38704, 33717, 27090, 43987, 30449, 27079, 38692, 27074, 32796, 38697}, + [71] = {42894, 43023, 43045}, + [72] = {42925, 42930, 42913}, + [73] = {43019, 42858}, + [74] = {42872, 42832, 42939}, + [75] = {42843, 42955, 44614, 42917, 42841}, + [76] = {42896, 42920, 43015}, + [77] = {43017, 42985}, + [78] = {43010, 42833, 42859, 42914}, + [79] = {42846, 43024, 43020, 42926, 43046, 42931, 43012, 42842, 43008}, + [80] = {42897, 43002, 42921, 42995, 42956, 55342, 58659, 42873, 47610, 42940}, + }, + ["Warlock"] = { + [2] = {688, 348}, + [4] = {172, 702}, + [6] = {1454, 695}, + [8] = {980, 5782}, + [10] = {1120, 6201, 696, 707}, + [12] = {1108, 755, 705}, + [14] = {6222, 689}, + [16] = {1455, 5697}, + [18] = {1014, 693, 5676}, + [20] = {706, 3698, 698, 1094, 5740, 1088, 5784}, + [22] = {6205, 699, 6202, 126}, + [24] = {6223, 5138, 8288, 5500}, + [26] = {1714, 1456, 132, 17919}, + [28] = {6217, 710, 6366, 3699, 1106}, + [30] = {709, 20752, 1086, 1098, 1949, 2941}, + [32] = {1490, 7646, 6213, 6229}, + [34] = {7648, 5699, 6219, 17920}, + [36] = {11687, 17951, 2362, 3700, 7641}, + [38] = {11711, 7651, 8289}, + [40] = {5484, 20755, 11733, 11665}, + [42] = {11707, 6789, 11739, 11683, 17921}, + [44] = {11671, 11725, 11693, 11659}, + [46] = {11721, 11699, 11688, 17952, 11729, 11677}, + [48] = {11712, 18647, 17727, 6353}, + [50] = {11719, 17925, 20756, 11734, 11667, 17922}, + [52] = {11708, 11675, 11694, 11740, 11660}, + [54] = {11672, 11700, 17928, 11684}, + [56] = {6215, 11689, 17953, 17924}, + [58] = {11713, 17926, 11730, 11726, 11678, 17923}, + [60] = {25311, 603, 11722, 20757, 17728, 11735, 11695, 28610, 11668, 11661}, + [61] = {27224}, + [62] = {27219, 28176, 25307}, + [64] = {29722, 27211}, + [65] = {27216, 27210}, + [66] = {27250, 28172, 29858}, + [67] = {27218, 27217, 27259}, + [68] = {27223, 27222, 27230, 29893, 27213}, + [69] = {27228, 30909, 27220, 28189, 27215, 27212, 27209}, + [70] = {30910, 27243, 27238, 27260, 32231, 30459, 30545}, + [71] = {47812, 50511}, + [72] = {47886, 61191, 47890, 47819}, + [73] = {47863, 47859, 47871}, + [74] = {60219, 47892, 47837, 47814, 47808}, + [75] = {47835, 47810, 47897, 47824}, + [76] = {47884, 47793, 47856}, + [77] = {47813, 47855}, + [78] = {47865, 47860, 47857, 47888, 47891, 47823}, + [79] = {47864, 47878, 47893, 47820, 47815, 47809}, + [80] = {47867, 57946, 47836, 60220, 47889, 48018, 48020, 58887, 47811, 47838, 61290, 47825}, + + }, + ["Druid"] = { + [2] = {1126}, + [4] = {8921, 774}, + [6] = {467, 5177}, + [8] = {339, 5186}, + [10] = {8924, 16689, 99, 5232, 1058}, + [12] = {5229, 8936, 50769}, + [14] = {782, 5178, 5211, 5187}, + [16] = {8925, 779, 1430}, + [18] = {1062, 770, 2637, 16810, 16857, 8938}, + [20] = {2912, 1082, 1735, 5215, 1079, 5188, 6756, 20484}, + [22] = {8926, 2908, 5179, 5221, 2090}, + [24] = {1075, 1822, 780, 5217, 8939, 2782, 50768}, + [26] = {8949, 1850, 2893, 5189}, + [28] = {5195, 8927, 16811, 5209, 3029, 8998, 9492, 2091}, + [30] = {5180, 6798, 6800, 5234, 20739, 8940, 740}, + [32] = {9490, 22568, 6785, 5225, 6778}, + [34] = {8928, 8950, 8914, 1823, 769, 3627}, + [36] = {22842, 9005, 9493, 6793, 8941, 50767}, + [38] = {5196, 18657, 16812, 8955, 6780, 5201, 8992, 8903}, + [40] = {16914, 29166, 8929, 9000, 9634, 20719, 22827, 62600, 8907, 20742, 8910, 8918}, + [42] = {8951, 9747, 6787, 9750}, + [44] = {22812, 9756, 1824, 9752, 9754, 9758}, + [46] = {9833, 8905, 8983, 9821, 9823, 9829, 9839}, + [48] = {9852, 16813, 9849, 22828, 9845, 9856, 50766}, + [50] = {17401, 9875, 9866, 21849, 9888, 9884, 20747, 9862}, + [52] = {9834, 9892, 9898, 9894, 9840}, + [54] = {9901, 9910, 9912, 9904, 9830, 9908, 9857}, + [56] = {22829, 9827, 9889}, + [58] = {9853, 18658, 9835, 17329, 9876, 9850, 9867, 9841}, + [60] = {17402, 25298, 31709, 31018, 33943, 9896, 9846, 21850, 25297, 9885, 20748, 9858, 25299, 50765, 9863}, + [61] = {26984, 27001}, + [62] = {26998, 22570, 26978}, + [63] = {26987, 24248, 26981}, + [64] = {26992, 27003, 26997, 33763}, + [65] = {33357, 26980}, + [66] = {33745, 27006, 27005}, + [67] = {26986, 27000, 27008}, + [68] = {26989, 27009}, + [69] = {26985, 27004, 26979, 26994, 26982, 50764}, + [70] = {33786, 27012, 26988, 26995, 27002, 26991, 26990, 26983}, + [71] = {48559, 49799, 40120, 62078, 50212, 48442}, + [72] = {48464, 48576, 48573, 48561, 48450}, + [73] = {48569, 48567, 48578}, + [74] = {53307, 48459, 49802, 48377}, + [75] = {48462, 52610, 48571, 48440, 48446}, + [76] = {48575}, + [77] = {48560, 49803, 48562, 48443}, + [78] = {53308, 53312, 48465, 48577, 48574}, + [79] = {48461, 48570, 48579, 50213, 48378, 48477}, + [80] = {48467, 48463, 48568, 49800, 48572, 48470, 48451, 48469, 50464, 48441, 50763, 48447}, + }, +} + + function Player:LearnLevelSpells(oldlevel) + local classString = self:GetClassAsString(); + local plrLevel = self:GetLevel(); + oldlevel = oldlevel or 1; + + while oldlevel <= plrLevel do + local spells = Classes[classString][oldlevel] or {}; + + for k,v in ipairs(spells) do + self:LearnSpell(v); + end + + oldlevel = oldlevel + 1; + end +end + + +local function OnLevelUp(event, player, oldlevel) + player:LearnLevelSpells(oldlevel); +end + +local function FirstLogin(event, player) + player:LearnLevelSpells(); +end + +RegisterPlayerEvent(13, OnLevelUp) +RegisterPlayerEvent(30,FirstLogin) \ No newline at end of file diff --git a/teleport.lua b/teleport.lua new file mode 100644 index 0000000..62f320a --- /dev/null +++ b/teleport.lua @@ -0,0 +1,130 @@ +--DEVKM +print("########") +print("Cargando teleport...") + +local NPCID = 190003 +local teleport = {} + +teleport.StandardTeleportIcon = 2 +teleport.StandardMenuIcon = 3 +teleport.WrongPassText = "Error de clave!" + +teleport.ports = { + {name = "Location 1", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "Location 2", mapid = 1, x = 2, y = 3, z = 4, o = 5, pass = "km"}, --clave + {name = "Location 3", mapid = 1, x = 2, y = 3, z = 4, o = 5, icon = 4}, + {name = "SubMenu1", + {name = "Location 4", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "Location 5", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "Location 6", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "SubSubMenu1", + {name = "Location 7", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "Location 8", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "Location 9", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "test", + {name = "Location 7", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "Location 8", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + {name = "Location 9", mapid = 1, x = 2, y = 3, z = 4, o = 5}, + }, + }, + }, +} + +local IDcount = 1 +teleport.Menu = {} + +function teleport.Analyse(list, from) + for k,v in ipairs(list) do + + v.ID = IDcount + v.FROM = from + v.ICON = v.icon or teleport.StandardTeleportIcon + IDcount = IDcount + 1 + teleport.Menu[v.ID] = v + + if not v.mapid then + teleport.Menu[v.ID].ICON = v.icon or teleport.StandardMenuIcon + teleport.Analyse(v, v.ID) + end + end +end + +print("Exportando teleport...") +teleport.Analyse(teleport.ports, 0) +print("Exportacion completa") + +table.find = function(_table, _tofind, _index) + for k,v in pairs(_table) do + if _index then + if v[_index] == _tofind then + return k + end + else + if v == _tofind then + return k + end + end + end +end + +table.findall = function(_table, _tofind, _index) + + local result = {} + for k,v in pairs(_table) do + if _index then + if v[_index] == _tofind then + table.insert(result, v) + end + else + if v == _tofind then + table.insert(result, v) + end + end + end + return result +end + +function teleport.BuildMenu(Unit, Player, from) + local MenuTable = table.findall(teleport.Menu, from, "FROM") + + for _,entry in ipairs(MenuTable) do + Player:GossipMenuAddItem(entry.ICON, entry.name, 0, entry.ID, entry.pass) + end + if from > 0 then + local GoBack = teleport.Menu[table.find(teleport.Menu, from, "ID")].FROM + Player:GossipMenuAddItem(7, "Atras..", 0, GoBack) + end + Player:GossipSendMenu(1, Unit) +end + +function teleport.OnTalk(Event, Player, Unit, _, ID, Password) + if Event == 1 or ID == 0 then + teleport.BuildMenu(Unit, Player, 0) + else + local M = teleport.Menu[table.find(teleport.Menu, ID, "ID")] + if not M then error("Esto no debería ocurrir") end + + if M.pass then + if Password ~= M.pass then + Player:SendNotification(teleport.WrongPassText) + Player:GossipComplete() + return + end + end + + if M.mapid then + Player:Teleport(M.mapid, M.x, M.y, M.z, M.o) + Player:GossipComplete() + return + end + + teleport.BuildMenu(Unit, Player, ID) + end +end + +print("Registrar NPC: "..NPCID) +RegisterCreatureGossipEvent(NPCID, 1, teleport.OnTalk) +RegisterCreatureGossipEvent(NPCID, 2, teleport.OnTalk) + +print("Multi teleport completado") +print("########") \ No newline at end of file diff --git a/top_clases.lua b/top_clases.lua new file mode 100644 index 0000000..7196314 --- /dev/null +++ b/top_clases.lua @@ -0,0 +1,45 @@ +---------------------------------------------- +-- TOP 5 per class // +-- Script by Renatokeys(emudevs) // +-- http://emudevs.com // +---------------------------------------------- + +local NPC_ID = 54 + +local T = { + [1] = {"Warrior", "660000"}, + [2] = {"Paladin", "FF0099"}, + [3] = {"Hunter", "CC6611"}, + [4] = {"Rogue", "CCFF00"}, + [5] = {"Priest", "FFFFFF"}, + [6] = {"Death Knight", "4D4D51"}, + [7] = {"Shaman", "0000CC"}, + [8] = {"Mage", "33FFFF"}, + [9] = {"Warlock", "660099"}, + [11] = {"Druid", "FF6600"} +}; + +function clica(event, plr, unit) + plr:GossipMenuAddItem(0, "Choose the class : ", 0, 0) + + for k, v in pairs(T) do + plr:GossipMenuAddItem(0, "TOP 5 |cff"..v[2]..v[1], 0, k) + end + + plr:GossipSendMenu(1, unit) +end + +function seleciona(event, plr, unit, arg2, intid) + if (intid > 0) then + plr:SendBroadcastMessage("|cff"..T[intid][2]..T[intid][1]) + + local resultado = CharDBQuery("SELECT name,totalKills FROM characters WHERE class='"..intid.."' ORDER BY totalKills DESC LIMIT 5") + repeat + local playername = resultado:GetString(0); + local kills = resultado:GetUInt32(1); + plr:SendBroadcastMessage("|cFF33CCFFPlayer : |r ".. playername .." , |cFF33CCFFwith : |r" .. kills .. " Kills") + until not resultado:NextRow() + end +end +RegisterCreatureGossipEvent(NPC_ID, 1, clica) +RegisterCreatureGossipEvent(NPC_ID, 2, seleciona) \ No newline at end of file diff --git a/world_chat.lua b/world_chat.lua new file mode 100644 index 0000000..77fcded --- /dev/null +++ b/world_chat.lua @@ -0,0 +1,52 @@ +--DEVKM +local ChatPrefix = "#w"; +local WorldChannelName = "Canal Global"; +local CooldownTimer = 5; -- Cooldown in seconds. Set to 0 for no CD obviously. + +local Class = { -- Class colors :) Prettier and easier than the elseif crap :) THESE ARE HEX COLORS! + [1] = "C79C6E", -- Warrior + [2] = "F58CBA", -- Paladin + [3] = "ABD473", -- Hunter + [4] = "FFF569", -- Rogue + [5] = "FFFFFF", -- Priest + [6] = "C41F3B", -- Death Knight + [7] = "0070DE", -- Shaman + [8] = "69CCF0", -- Mage + [9] = "9482C9", -- Warlock + [11] = "FF7d0A" -- Druid +}; + +local Rank = { + [0] = "7DFF00", -- Player + [1] = "E700B1", -- Moderator + [2] = "E7A200", -- Game Master + [3] = "E7A200", -- Admin + [4] = "E7A200" -- Console +}; + + -- Do not edit below unless you know what you're doing :) +if (ChatPrefix:sub(-1) ~= " ") then + ChatPrefix = ChatPrefix.." "; +end + +local RCD = {}; +function ChatSystem(event, player, msg, _, lang) + if (RCD[player:GetGUIDLow()] == nil) then + RCD[player:GetGUIDLow()] = 0; + end + if (msg:sub(1, ChatPrefix:len()) == ChatPrefix) then + local r = RCD[player:GetGUIDLow()] - os.clock(); + if (0 < r) then + local s = string.format("|cFFFF0000Debes esperar %i segundos(s) para enviar otro mensaje!|r", math.floor(r)); + player:SendAreaTriggerMessage(s); + else + RCD[player:GetGUIDLow()] = os.clock() + CooldownTimer; + local t = table.concat({"|cff7DFF00[", WorldChannelName, "] [|r|cff", Rank[player:GetGMRank()] or Rank[0], "|Hplayer:", player:GetName(), "|h", player:GetName(), "|h|r|cff7DFF00]: |r|cff", Class[player:GetClass()], msg:sub(ChatPrefix:len()+1), "|r"}); + SendWorldMessage(t); + end + return false; + end +end + +RegisterPlayerEvent(18, ChatSystem); +RegisterPlayerEvent(4, function(_, player) RCD[player:GetGUIDLow()] = 0; end); \ No newline at end of file