Code:
local NPC_Entry1 = -- this is for the invis npcs
local NPC_Entry2 = -- that will be alucards taunt whispers :DDD
local Inrange_Distance = 3
local Alucard =
local Bloodcreature = -- the creature that spawns on death of a player to attack group
local bloodorb = 0
local batnpcid = -------npc id of the bat you wanna use for his bat tele
local Allu
local bat
batspawn(unit, event)
bat = unit
end
function checkntaunt(unit, event)
local plrs = unit:GetInRangePlayers()
for k, v in pairs(plrs) do
Unit:SendChatMessageToPlayer(6, 0, "Are you afraid of the dark mortal? You better be. Leave now and I may spare your pitiful life.", v)
end
end
function playercheck_NPC(unit, event)
local plrs = unit:GetInRangePlayers()
for k, v in pairs(plrs) do
unit:SendChatMessageToPlayer(6, 0, "*Snarl* I TOLD YOU TO LEAVE! Now you are at the mercy of the most powerful of vampires! It is your own fault.", v)
unit:RegisterEvent("Trigger", 3000, 0)
end
end
function Trigger(unit, event, player)
local x = Unit:GetX()
local y = Unit:GetY()
local z = Unit:GetZ()
local o = Unit:GetO()
local plrs = unit:GetInRangePlayers()
for k, v in pairs(plrs) do
if (unit:GetDistance(v) < Inrange_Distance) then
unit:SpawnCreature(Alucard, x, y, z, o, 35, 0)
end
end
end
function Alluspawn(unit, event)
Allu = unit
unit:SendChatMessage(14, 0, "I am the great Alucard, King of Undeath, and You all intrude on my upon my solemn meditation. For such insolence I will crush you with my power, You quivering insects!")
unit:RegisterEvent("factionswitch", 5000, 0)
end
function factionswitch(unit, event, player)
unit:SetFaction(14)
end
function Alluoncombat(unit, event, player)
unit:RegisterEvent("Bloodsplash", 8000, 0)
unit:RegisterEvent("BloodDoT", 30000, 0)
unit:RegisterEvent("Blink1", 35000, 0)
end
function Bloodsplash(unit, event, player)
unit:FullCastSpellOnTarget(71481, unit:GetRandomPlayer(0))
unit:SetHealthPct(unit:GetHealthPct()+1)
end
function BloodDoT(unit, event, player)
unit:FullCastSpellOnTarget(72441, unit:GetMainTank())
unit:SetHealthPct(unit:GetHealthPct()+2)
end
function Blink1(unit, event, player)
blink=math.random(1,4)
if (blink == 1) then
local x = unit:GetX()
local y = unit:GetY()
local z = unit:GetZ()
local o = unit:GetO()
Allu:SpawnCreature(batnpcid, x, y, z, o, 35, 5000)
bat:MoveTo(x+3, y, z, o)
Allu:SetModel(11686)
Allu:MoveTo(x+3, y, z, o)
Allu:RegisterEvent("unblink", 5000, 0)
end
if (blink == 2) then
local x = unit:GetX()
local y = unit:GetY()
local z = unit:GetZ()
local o = unit:GetO()
Allu:SpawnCreature(batnpcid, x, y, z, o, 35, 5000)
bat:MoveTo(x-3, y, z, o)
Allu:SetModel(11686)
Allu:MoveTo(x-3, y, z, o)
Allu:RegisterEvent("unblink", 5000, 0)
end
if (blink == 3) then
local x = unit:GetX()
local y = unit:GetY()
local z = unit:GetZ()
local o = unit:GetO()
Allu:SpawnCreature(batnpcid, x, y, z, o, 35, 5000)
bat:MoveTo(x, y+3, z, o)
Allu:SetModel(11686)
Allu:MoveTo(x, y+3, z, o)
Allu:RegisterEvent("unblink", 5000, 0)
end
if (blink == 4) then
local x = unit:GetX()
local y = unit:GetY()
local z = unit:GetZ()
local o = unit:GetO()
Allu:SpawnCreature(batnpcid, x, y, z, o, 35, 5000)
bat:MoveTo(x, y-3, z, o)
Allu:SetModel(11686)
Allu:MoveTo(x, y-3, z, o)
Allu:RegisterEvent("unblink", 5000, 0)
end
function Alluleave(unit, Event)
unit:SendChatMessage(14, 0, "You should have ran when you had the chance..... Blame yourselves....")
unit:RemoveEvents()
end
function unblink(unit, event, player)
Allu:SetModel(0)
end
function Allufeeds(unit, event, player)
words=math.random(1,5)
if (words == 1) then
unit:SendChatMessage(14, 0, "Your blood tastes sweet and delicious. I crave more!")
end
if (words == 2) then
unit:SendChatMessage(14,0,"Your blood is filthy, I almost wish I hadn't drained you of it!")
end
if (words == 3) then
unit:SendChatMessage(14,0,"Mmmmmm, Your fluids taste spicey, It's a fiesta in my mouth!")
if (words == 4) then
unit:SendChatMessage(14,0," More! Bring me more blood! I crave it!")
if (words == 5) then
unit:SendChatMessage(14,0," The more I slay the more powerful I become! Bwahahaha!")
end
unit:SetHealthPct(unit:GetHealthPct()+10)
local x = Unit:GetX()
local y = Unit:GetY()
local z = Unit:GetZ()
local o = Unit:GetO()
local bloodorb = bloodorb + 1
unit:SpawnCreature(Bloodcreature, x+1, y+1, z, o, 14, 0)
unit:RegisterEvent("ConsumeBloodOrb", 1000, 0)
local plrs = unit:GetInRangePlayers()
for k, v in pairs(plrs) do
v:SendBroadcastMessage("|cFFCC0000Allucard has gained a Blood Orb!|r")
end
end
end
end
function ConsumeBloodOrb(unit, event)
if pUnit:GetHealthPct() <= 3 then
if bloodorb > 0 then
local bloodorb - 1
unit:SetHealthPct(unit:GetHealthPct()+60)
local plrs = unit:GetInRangePlayers()
for k, v in pairs(plrs) do
v:SendBroadcastMessage("|cFFCC0000Allucard has consumed a Blood Orb!|r")
end
end
end
end
function AlluDead(unit, event)
local bloodorb = 0
unit:SendChatMessage(14,0,"I am not truly dead, I shall return another day to devour your essence, until then, Farewell!")
unit:RemoveEvents()
end
function creatureoncombat(unit, event, player)
unit:ChannelSpell(72303 ,unit:GetClosestPlayer())
unit:RegisterEvent("inflictdmg", 1000, 0)
end
function inflinctdmg(unit, event, player)
unit:GetClosestPlayer(player:SetHealthPct(player:GetHealthPct()-5))
end
function creatureDead(unit, event, player)
unit:RemoveEvents()
unit:Despawn()
end
RegisterUnitEvent(NPC_Entry1, 18, "checkntaunt")
RegisterUnitEvent(NPC_Entry2, 18, "playercheck_NPC")
RegisterUnitEvent(Allucard, 18, "Alluspawn")
RegisterUnitEvent(Allucard, 1, "Alluoncombat")
RegisterUnitEvent(Allucard, 2, "Alluleave")
RegisterUnitEvent(Allucard, 3, "Allufeeds")
RegisterUnitEvent(Allucard, 4, "AlluDead"
RegisterUnitEvent(Bloodcreature, 1, "creatureoncombat")
RegisterUnitEvent(Bloodcreature, 4, "creatureDead")
RegisterUnitEvent(batnpcid, 18, "batspawn")