Add files via upload

This commit is contained in:
Dinkledork
2023-03-07 20:43:48 -07:00
committed by GitHub
parent fa1b1a8b65
commit 853f202792
19 changed files with 153 additions and 74 deletions

View File

@@ -22,12 +22,6 @@ creature:CastSpell(creature:GetVictim(), 49999, true)
end
local function CastDeathGrip(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
local target = targets[math.random(#targets)]
creature:CastSpell(target, 49576, true)
end
local function CastAntiMagicShield(eventId, delay, calls, creature)
creature:CastSpell(creature, 24021, true)
end
@@ -40,7 +34,6 @@ local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastIcyTouch, 5000, 0)
creature:RegisterEvent(CastPlagueStrike, 6000, 0)
creature:RegisterEvent(CastDeathstrike, 25000, 0)
creature:RegisterEvent(CastDeathGrip, 20000, 0)
creature:RegisterEvent(CastBloodBoil, math.random(12000, 18000), 0)
creature:RegisterEvent(CastDnD, 100, 1)
end

View File

@@ -23,7 +23,8 @@ creature:RemoveEvents()
end
function BlightedZombie.OnDeath(event, creature, killer)
creature:RemoveEvents()
creature:RemoveCorpse()
creature:RemoveEvents()
end
RegisterCreatureEvent(400051, 1, BlightedZombie.OnCombat)

View File

@@ -6,39 +6,40 @@ Bonk.ITEM_ID2 = 37500 -- replace with the ID of the new item you want to give
-- Register the gossip event for the NPC
function Bonk.OnGossipHello(event, player, creature)
player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_druid_flightform:50:50:-13:0|tMech Wings for 25 silver.", 0, 1)
player:GossipMenuAddItem(0, "|TInterface\\Icons\\ability_druid_flightform:50:50:-13:0|tMech Wings for 75 silver.", 0, 1)
player:GossipMenuAddItem(0, "|TInterface\\Icons\\inv_misc_key_14:50:50:-13:0|tKeys to a Shredder for 45 silver.", 0, 2)
player:GossipSendMenu(1, creature)
end
-- Handle the player's selection in the gossip menu
function Bonk.OnGossipSelect(event, player, creature, sender, action)
if action == 1 then
if player:GetCoinage() < 2500 then
player:SendBroadcastMessage("You do not have enough silver.")
player:GossipComplete()
else
player:SetCoinage(player:GetCoinage() - 2500)
player:AddItem(Bonk.ITEM_ID, 1)
player:SendBroadcastMessage("You have received Mech Wings.")
player:GossipComplete()
end
elseif action == 2 then
if player:GetCoinage() < 3500 then
player:SendBroadcastMessage("You have received keys to a Refurbished Shredder.")
player:GossipComplete()
else
player:SetCoinage(player:GetCoinage() - 4500)
player:AddItem(Bonk.ITEM_ID2, 1)
player:SendBroadcastMessage("You have received Mech Wings.")
player:GossipComplete()
end
end
function Bonk.OnGossipSelect(event, player, creature, sender, intid, code)
if intid == 1 then
if player:GetCoinage() < 7500 then
player:SendBroadcastMessage("You don't have enough coins.")
player:GossipComplete()
else
player:SetCoinage(player:GetCoinage() - 7500)
player:AddItem(Bonk.ITEM_ID, 1)
player:SendBroadcastMessage("You have received Mech Wings.")
player:GossipComplete()
end
elseif intid == 2 then
if player:GetCoinage() < 4500 then
player:SendBroadcastMessage("You don't have enough coins.")
player:GossipComplete()
else
player:SetCoinage(player:GetCoinage() - 4500)
player:AddItem(Bonk.ITEM_ID2, 1)
player:SendBroadcastMessage("You have received keys to a Refurbished Shredder.")
player:GossipComplete()
end
end
end
-- Send a unit yell when the NPC spawns
function Bonk.OnSpawn(event, creature)
creature:SendUnitYell("I've got Mech Wings and keys to Refurbished Shredders!", 0)
creature:SendUnitYell("Step right up! I've got Mech Wings and keys to Refurbished Shredders!", 0)
creature:CastSpell(creature, 20374)
end

View File

@@ -18,6 +18,7 @@ local function OnLeaveCombat(event, creature)
end
local function OnDied(event, creature, killer)
creature:RemoveCorpse()
creature:RemoveEvents()
end

View File

@@ -28,9 +28,9 @@ creature:CastSpell(creature:GetVictim(), 50581, true)
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastShadowBolt, math.random(5000, 8000), 0)
creature:RegisterEvent(CastShadowBolt, math.random(8000, 12000), 0)
creature:RegisterEvent(CastShadowBoltVolley, math.random(11000, 18000), 0)
creature:RegisterEvent(CastRainOfFire, math.random(22000, 31000), 0)
creature:RegisterEvent(CastRainOfFire, math.random(12000, 31000), 0)
creature:RegisterEvent(CastCurseOfPain, math.random(13000, 18000), 0)
creature:RegisterEvent(CastShadowMend, math.random(11000, 20000), 0)
creature:RegisterEvent(CastShadowStrike, math.random(2000, 5000), 0)
@@ -46,7 +46,7 @@ end
local function OnSpawn(event, creature)
creature:SendUnitYell("You will submit to the power of the Lich King.", 0)
creature:SetMaxHealth(812760)
creature:SetMaxHealth(1812760)
creature:CastSpell(creature, 17683, true)
end

8
FlyableWaypoints.lua Normal file
View File

@@ -0,0 +1,8 @@
local Waypoint = {};
function Waypoint.OnSpawn(event, creature)
creature:CanFly(true)
creature:SetDisableGravity(true)
end
RegisterCreatureEvent(1, 5, Waypoint.OnSpawn)

View File

@@ -24,6 +24,7 @@ local function OnLeaveCombat(event, creature)
end
local function OnDied(event, creature, killer)
creature:RemoveCorpse()
creature:RemoveEvents()
end

View File

@@ -5,39 +5,49 @@ local banTimer = 999999999
--on death function - checks if player has token and bans character if it does.
local function PlayerDeath(event, killer, killed)
if(killed:HasItem(90000,1)) then
print(killed:GetName() .. " was killed by " .. killer:GetName())
SendWorldMessage(killed:GetName() .. " was killed by " .. killer:GetName())
Ban(1,killed:GetName(),banTimer)
end
if killed:HasItem(90000,1) and killed:GetLevel() == 1 then
print(killed:GetName() .. " was killed by " .. killer:GetName())
SendWorldMessage(killed:GetName() .. " was killed by " .. killer:GetName())
Ban(1,killed:GetName(),banTimer)
end
end
--First Gossip Screen for NPC
function OnFirstTalk(event, player, unit)
player:GossipMenuAddItem(0, "Looking for a challenge? Click here to try hardcore mode!", 0, 1)
player:GossipSendMenu(1, unit)
if player:GetLevel() == 1 then
player:GossipMenuAddItem(0, "Looking for a challenge? Click here to try hardcore mode!", 0, 1)
player:GossipSendMenu(1, unit)
else
player:SendBroadcastMessage("You must be level 1 to access hardcore mode.")
player:GossipComplete()
end
end
--Selection for NPC gossip
function OnSelect(event, player, unit, sender, intid, code)
if (intid == 1) then
player:GossipMenuAddItem(0, "Just double checking to make sure that you want to turn on hardcore mode. This will lock the character after death to be no longer playable! I will likely be adding rewards for reaching certain stages of the game later...", 0, 2)
player:GossipMenuAddItem(0, "NO TAKE ME BACK!", 0, 3)
player:GossipSendMenu(2, unit)
end
if intid == 1 then
player:GossipMenuAddItem(0, "Just double checking to make sure that you want to turn on hardcore mode. This will lock the character after death to be no longer playable, remove all your current gold, remove bonus starter items and Murky will no longer be with you! I will likely be adding rewards for reaching certain stages of the game later...", 0, 2)
player:GossipMenuAddItem(0, "NO TAKE ME BACK!", 0, 3)
player:GossipSendMenu(2, unit)
end
end
--if player chooses to do hardcore they receive the token
--if player chooses to do hardcore they receive the token and have custom items and Murky removed
function OnHardCore(event, player, unit, sender, intid, code)
if (intid == 2) then
player:AddItem(90000, 1)
--else gossip ends
else
player:GossipComplete()
end
if intid == 2 then
player:AddItem(90000, 1)
player:SetCoinage(0)
player:RemoveItem(60002, player:GetItemCount(60002))
player:RemoveItem(10594, player:GetItemCount(10594))
player:RemoveItem(65000, player:GetItemCount(65000))
player:RemoveSpell(24939)
--else gossip ends
else
player:GossipComplete()
end
end
RegisterCreatureGossipEvent(hcNPC, 1 , OnFirstTalk)
RegisterCreatureGossipEvent(hcNPC, 2, OnSelect)
RegisterCreatureGossipEvent(hcNPC, 2, OnHardCore)
RegisterPlayerEvent(8, PlayerDeath)
RegisterPlayerEvent(8, PlayerDeath)

37
HardcoreItemRemoval.lua Normal file
View File

@@ -0,0 +1,37 @@
local function hasItem90000(player)
return player:GetItemCount(90000) > 0
end
-- Remove custom starter items
local function removeItems(player)
local removed = false
local items = {60002, 10594, 65000}
for _, entry in ipairs(items) do
local itemCount = player:GetItemCount(entry)
if itemCount > 0 then
for i = 0, itemCount - 1 do
player:RemoveItem(entry, 1)
end
removed = true
end
end
return removed
end
-- Remove Murky
local function removeSpell(player)
player:RemoveSpell(24939)
end
-- Script body
local function onLogin(event, player)
if hasItem90000(player) then
if removeItems(player) then
player:SendBroadcastMessage("Welcome to Hardcore Mode. Please watch your step!")
end
removeSpell(player)
end
end
-- Register the script to be triggered on player login
RegisterPlayerEvent(3, onLogin)

View File

@@ -1,4 +1,4 @@
local BRAVE_IDS = {5412, 5511, 5512, 957, 7798, 11026, 5518, 5510, 5509, 1416, 5514, 29016, 29019, 3518, 1472}
local BRAVE_IDS = {5412, 5511, 5512, 957, 7798, 11026, 5518, 5510, 5509, 1416, 5514, 29016, 29019, 3518, 1472, 31423, 3314, 3312, 3323}
local BRAVERY_DIALOGUE = {
"I fear no enemy!",
"I will fight to the bitter end!",

View File

@@ -20,6 +20,7 @@ creature:RemoveEvents()
end
function Necrofiend.OnDied(event, creature, killer)
creature:RemoveCorpse()
creature:RemoveEvents()
end

View File

@@ -1,7 +1,11 @@
local OrgArcher = {};
local OrgArcher = {}
local function CastShoot(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 37770, true)
local range = 200 -- set range to 200 yards
local target = creature:GetNearestCreature(range, 400035) -- find nearest target within range
if target ~= nil then
creature:CastSpell(target, 37770, true) -- cast shoot on target
end
end
local function CastSerpentSting(eventId, delay, calls, creature)
@@ -12,12 +16,20 @@ local function CastMultiShot(eventId, delay, calls, creature)
creature:CastSpell(creature:GetVictim(), 30990, true)
end
local function CastShootOnSpawn(event, creature)
local range = 200 -- set range to 200 yards
local target = creature:GetNearestCreature(range, 400035) -- find nearest target within range
if target ~= nil then
creature:CastSpell(target, 37770, true) -- cast shoot on target
end
end
local function OnEnterCombat(event, creature, target)
creature:RegisterEvent(CastShoot, 750, 0)
creature:RegisterEvent(CastSerpentSting, 15000, 0)
creature:RegisterEvent(CastMultiShot, 5000, 0)
end
creature:RegisterEvent(CastShoot, 750, 0)
creature:RegisterEvent(CastSerpentSting, 15000, 0)
creature:RegisterEvent(CastMultiShot, 5000, 0)
end
local function OnLeaveCombat(event, creature)
creature:RemoveEvents()
end
@@ -28,4 +40,6 @@ end
RegisterCreatureEvent(400041, 1, OnEnterCombat)
RegisterCreatureEvent(400041, 2, OnLeaveCombat)
RegisterCreatureEvent(400041, 4, OnDied)
RegisterCreatureEvent(400041, 4, OnDied)
RegisterCreatureEvent(400035, 5, CastShootOnSpawn)

View File

@@ -20,6 +20,7 @@ local function OnLeaveCombat(event, creature)
end
local function OnDied(event, creature, killer)
creature:RemoveCorpse()
creature:RemoveEvents()
end

13
RefurbishedShredder.lua Normal file
View File

@@ -0,0 +1,13 @@
local RShredder = {};
function RShredder.OnSpawn(event, creature)
creature:CastSpell(creature, 17683, true)
end
function RShredder.OnDied(event, creature)
creature:RemoveCorpse()
creature:RemoveEvents()
end
RegisterCreatureEvent(400044, 4, RShredder.OnDied)
RegisterCreatureEvent(400044, 5, RShredder.OnSpawn)

View File

@@ -1,7 +1,7 @@
local undeadDragon = {}
function undeadDragon.OnSpawn(event, creature)
creature:SetMaxHealth(5554119)
creature:SetMaxHealth(8554119)
creature:CanFly(true)
creature:SetDisableGravity(true)
creature:SetReactState(0)
@@ -17,7 +17,6 @@ creature:RegisterEvent(undeadDragon.CastSpell4, 6000, 0)
creature:RegisterEvent(undeadDragon.CastSpell5, 23000, 0)
creature:RegisterEvent(undeadDragon.CastSpell6, 35000, 0)
creature:RegisterEvent(undeadDragon.CastBlizzard, 4000, 0)
creature:RegisterEvent(undeadDragon.CastFlameBreath, 19000, 0) -- added event to cast Flame Breath every 19 seconds
end
function undeadDragon.OnLeaveCombat(event, creature)
@@ -90,12 +89,6 @@ end
end
end
function undeadDragon.CastFlameBreath(event, delay, pCall, creature)
local enemies = creature:GetUnfriendlyUnitsInRange(30)
if not creature:IsCasting() and #enemies > 0 then
creature:CastSpell(creature:GetVictim(), 100172, false) -- Frost Breath
end
end
function undeadDragon.OnDeath(event, creature, killer)
creature:RemoveEvents()

View File

@@ -25,6 +25,7 @@ creature:RemoveEvents()
end
function SkeletalWarlord.OnDied(event, creature, killer)
creature:RemoveCorpse()
creature:RemoveEvents()
end

View File

@@ -3,7 +3,7 @@ local ALLOWED_MAPS = {
1,
}
local ALLOWED_SPELLS = {100150, 100160, 10061}
local ALLOWED_SPELLS = {100150, 100160, 100161, 100177}
function table.indexOf(t, value)
for k, v in ipairs(t) do

View File

@@ -29,6 +29,7 @@ creature:RemoveEvents()
end
function SpectralAttendant.OnDied(event, creature, killer)
creature:RemoveCorpse()
creature:RemoveEvents()
end

View File

@@ -6,6 +6,9 @@ end
local function StoneStomp(eventId, delay, calls, creature)
local targets = creature:GetAITargets(10)
if #targets == 0 then
return
end
local target = targets[math.random(#targets)]
creature:CastSpell(target, 49675, true)
end