mirror of
https://github.com/araxiaonline/RandomScriptsforAzerothCore.git
synced 2026-06-13 02:22:19 -04:00
Add files via upload
This commit is contained in:
10
Faction_Shared/Blight.lua
Normal file
10
Faction_Shared/Blight.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
local NPC_CUSTOM = 400119
|
||||
local WANDER_RADIUS = 5
|
||||
|
||||
function CustomNPC_OnSpawn(event, creature)
|
||||
creature:SetDefaultMovementType(1)
|
||||
creature:SetWanderRadius(WANDER_RADIUS)
|
||||
creature:MoveRandom(WANDER_RADIUS)
|
||||
end
|
||||
|
||||
RegisterCreatureEvent(NPC_CUSTOM, 5, CustomNPC_OnSpawn)
|
||||
@@ -1,44 +1,54 @@
|
||||
local BlisteringZombie = {};
|
||||
|
||||
local function CastArmyOfTheDead(eventId, delay, calls, creature)
|
||||
creature:CastSpell(creature, 42650, true)
|
||||
creature:CastSpell(creature, 42650, true)
|
||||
end
|
||||
|
||||
local function CastSpit(eventId, delay, calls, creature)
|
||||
creature:CastSpell(creature:GetVictim(), 25262, true)
|
||||
creature:CastSpell(creature:GetVictim(), 25262, true)
|
||||
end
|
||||
|
||||
local function CastSpecialSpell(eventId, delay, calls, creature)
|
||||
local victim = creature:GetVictim()
|
||||
if not victim then
|
||||
return
|
||||
end
|
||||
if victim:GetEntry() == 32666 or victim:GetEntry() == 32667 or victim:GetEntry() == 31144 or victim:GetEntry() == 31146 then
|
||||
creature:CastSpell(victim, 5, true)
|
||||
end
|
||||
local victim = creature:GetVictim()
|
||||
if not victim then
|
||||
return
|
||||
end
|
||||
if victim:GetEntry() == 32666 or victim:GetEntry() == 32667 or victim:GetEntry() == 31144 or victim:GetEntry() == 31146 then
|
||||
creature:CastSpell(victim, 5, true)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
local function OnEnterCombat(event, creature, target)
|
||||
creature:RegisterEvent(CastArmyOfTheDead, 25000, 0)
|
||||
creature:RegisterEvent(CastSpit, 5000, 0)
|
||||
creature:RegisterEvent(CastSpecialSpell, 1000, 0)
|
||||
creature:RegisterEvent(CastArmyOfTheDead, 25000, 0)
|
||||
creature:RegisterEvent(CastSpit, 5000, 0)
|
||||
creature:RegisterEvent(CastSpecialSpell, 1000, 0)
|
||||
end
|
||||
|
||||
local function OnLeaveCombat(event, creature)
|
||||
creature:RemoveEvents()
|
||||
creature:RemoveEvents()
|
||||
end
|
||||
|
||||
local function OnSpawn(event, creature)
|
||||
creature:RegisterEvent(CastArmyOfTheDead, 1000, 1)
|
||||
creature:RegisterEvent(CastArmyOfTheDead, 1000, 1)
|
||||
end
|
||||
|
||||
local function OnDied(event, creature, killer)
|
||||
creature:DespawnOrUnsummon(5000)
|
||||
creature:RemoveEvents()
|
||||
creature:DespawnOrUnsummon(5000)
|
||||
creature:RemoveEvents()
|
||||
end
|
||||
|
||||
local function OnWaypointReached(event, creature)
|
||||
if math.random(1, 100) <= 50 then -- 50% chance to spawn 400019
|
||||
local x, y, z, o = creature:GetLocation()
|
||||
local xOffset = math.random(-10, 10)
|
||||
local yOffset = math.random(-10, 10)
|
||||
local nx, ny, nz = x + xOffset, y + yOffset, z
|
||||
creature:SpawnCreature(400119, nx, ny, nz, o, 3, 200000)
|
||||
end
|
||||
end
|
||||
|
||||
RegisterCreatureEvent(400029, 1, OnEnterCombat)
|
||||
RegisterCreatureEvent(400029, 2, OnLeaveCombat)
|
||||
RegisterCreatureEvent(400029, 4, OnDied)
|
||||
RegisterCreatureEvent(400029, 5, OnSpawn)
|
||||
RegisterCreatureEvent(400029, 5, OnSpawn)
|
||||
RegisterCreatureEvent(400029, 6, OnWaypointReached)
|
||||
|
||||
@@ -1,20 +1,37 @@
|
||||
local BlisteringZombie = {};
|
||||
|
||||
local NPC_HUT_FIRE = 29692
|
||||
local FIRE_SPAWN_CHANCE = 20
|
||||
local FIRE_SPAWN_RADIUS = 35
|
||||
local FIRE_DESPAWN_TIME = 400000
|
||||
|
||||
function BlisteringZombie.OnSpawn(event, creature)
|
||||
creature:SetMaxHealth(8224)
|
||||
creature:CastSpell(creature:GetVictim(), 17683, true)
|
||||
creature:SetMaxHealth(8224)
|
||||
creature:CastSpell(creature:GetVictim(), 17683, true)
|
||||
end
|
||||
|
||||
function BlisteringZombie.OnCombat(event, creature, target)
|
||||
creature:RegisterEvent(BlisteringZombie.Ability1, 8000, 0)
|
||||
creature:RegisterEvent(BlisteringZombie.Ability1, 8000, 0)
|
||||
end
|
||||
|
||||
function BlisteringZombie.Ability1(event, delay, calls, creature)
|
||||
creature:CastSpell(creature:GetVictim(), 64153, true)
|
||||
creature:CastSpell(creature:GetVictim(), 64153, true)
|
||||
end
|
||||
|
||||
function BlisteringZombie.OnLeaveCombat(event, creature)
|
||||
creature:RemoveEvents()
|
||||
creature:RemoveEvents()
|
||||
end
|
||||
|
||||
function BlisteringZombie.OnWaypointReached(event, creature)
|
||||
local chance = math.random(1, 100)
|
||||
local areaId = creature:GetAreaId()
|
||||
if chance <= FIRE_SPAWN_CHANCE and (areaId == 380 or areaId == 69) then
|
||||
local x, y, z, o = creature:GetLocation()
|
||||
local xOffset = math.random(-FIRE_SPAWN_RADIUS, FIRE_SPAWN_RADIUS)
|
||||
local yOffset = math.random(-FIRE_SPAWN_RADIUS, FIRE_SPAWN_RADIUS)
|
||||
local nx, ny, nz = x + xOffset, y + yOffset, z
|
||||
creature:SpawnCreature(NPC_HUT_FIRE, nx, ny, nz, o, 3, FIRE_DESPAWN_TIME)
|
||||
end
|
||||
end
|
||||
|
||||
function BlisteringZombie.OnDeath(event, creature, killer)
|
||||
@@ -25,4 +42,5 @@ end
|
||||
RegisterCreatureEvent(400077, 1, BlisteringZombie.OnCombat)
|
||||
RegisterCreatureEvent(400077, 2, BlisteringZombie.OnLeaveCombat)
|
||||
RegisterCreatureEvent(400077, 4, BlisteringZombie.OnDeath)
|
||||
RegisterCreatureEvent(400077, 5, BlisteringZombie.OnSpawn)
|
||||
RegisterCreatureEvent(400077, 5, BlisteringZombie.OnSpawn)
|
||||
RegisterCreatureEvent(400077, 6, BlisteringZombie.OnWaypointReached)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
local TREE_CREATURE_ID = 400091
|
||||
local GOSSIP_OPTION_CUT_TREE = 1
|
||||
local LOG_ITEM_ID = 60116
|
||||
local BARRIERS_BUILT_QUEST_ID = 30012
|
||||
@@ -8,6 +9,7 @@ function OnCreatureSpawn(event, creature)
|
||||
end
|
||||
|
||||
function OnGossipHello(event, player, creature)
|
||||
if creature == nil or creature:GetEntry() ~= TREE_CREATURE_ID then return end
|
||||
if player:IsMounted() then
|
||||
player:SendBroadcastMessage("You must dismount first!")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user