• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Headless Horseman Script

Render1982

Emulation Addict
Hallow's End Scripts

Hey guys, I wanted to give back to the community by sharing this script that I used to make a level 11 World Event Boss in replacement of the town's Hallow's end quests.

I can share the SQL later today, I have tested it and it works great :D
Not sure about the sounds though since my speakers are disfunctional :(

Code:
--[[ Summary

		Description:
		A short simple script that scripts a Custom mini-boss for 
		low levels for the Hallow's End Event (Event ID 12)
		Its basically the Horseman's attack on the towns without 
		putting out fires. Maybe Future?
		
		--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		
		TODO:
					
		Pumpkin Adds: Derived from Kruul's LUA Script  			
				
		--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		
		Spells:
		Cleave - 15496 - Inflicts 110% of weapon damage to an enemy and its nearest ally.
		Conflagration - 42380 - Sets an enemy aflame, inflicting 5% of maximum health as Fire damage every 1 sec and sending it into a state of panic for 4 sec. 
		While the target is affected, the flames periodically scorch its nearby allies as well. ** This spell targets a random player and casts the spell ** 
		SummonPumpkins
		
		--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
		
		Developed By:
		Promotion (In-Game Name)
		(Render1982)
		
		Credits:
		EmuDevs (For the API would've never have done this without it xD and all its Members for support and kindly nature!)
		
		Notes:
		I have put comments through out to remind myself and maybe others about what each line is.
		
		
-]]
local entry = 500200 -- NPC Entry

local function CastCleave(eventId, dely, calls, creature) -- Cleave
    creature:CastSpell(creature:GetVictim(), 15496, true)
end

local function CastConflagration(eventId, dely, calls, creature) -- BURN THE PLAYER!
		if (math.random(1, 100) <= 75) then
			local players = creature:GetPlayersInRange()
			creature:CastSpell(players[math.random(1, #players)], 42380)
			creature:SendUnitYell("Harken, cur! Tis you I spurn! Now feel... the burn!", 0)
			creature:PlayDirectSound(12573)
	end
end

local function OnSpawn(event, creature) -- The Horseman Spawns
	creature:SendUnitYell("Prepare yourselves, the bells have tolled! Shelter your weak, your young and your old! Each of you shall pay the final sum! CRY for mercy! THE RECKONING HAS COME!", 0)
	creature:PlayDirectSound(11966)
	creature:RemoveEvents()
end	

local function OnTargetDied(event, creature, victim) -- A player was Defeated
	creature:SendUnitYell("Your body lies beaten, battered and broken! Let my curse be your own, fate has spoken!", 0)
	creature:PlayDirectSound(11962)
end

local function OnEnterCombat(event, creature, target) -- Activate his Spells
    creature:RegisterEvent(CastCleave, 7000, 0) 
	creature:RegisterEvent(CastConflagration, 12000, 0)
	-- creature:RegisterEvent(SpawnPumpkins, 15000, 1) -- Will Activate at a later time
	creature:SendUnitYell("It is over, your search is done! Let fate choose now, the righteous one!",0)
	creature:PlayDirectSound(11961)
	
end

--[[

-- Will be Activated Later

local function SummonPumpkins(creature, target)
		local x, y, z = GetRelativePoint(math.random()*9, math.random()*math.pi*2)
		local pumpkin = creature:SpawnCreature(Pumpkin Entry, x, y, z, 0, 2, 300000)
		if (pumpkin) then
			pumpkin:AttackStart(target)
	end
end

local function SpawnPumpkins(event, delay, pCall, creature)
	SummonPumpkins(creature, creature:GetVictim())
	SummonPumpkins(creature, creature:GetVictim())
	SummonPumpkins(creature, creature:GetVictim())
	creature:RegisterEvent(SpawnPumpkins, 45000, 0)
end	

--]]

local function OnLeaveCombat(event, creature)
    creature:PlayDirectSound(11965) -- Group Wiped 
	creature:SendUnitEmote("The Horseman Cackles") -- Horseman Laughs
    creature:RemoveEvents()
end

local function OnDied(event, creature, killer)
	creature:SendUnitYell("This end... have I reached before. What new adventure lies in store?", 0) -- Players Were Successful
	creature:PlayDirectSound(11964)
    creature:RemoveEvents()
end

-- Register the Horseman's Events 
RegisterCreatureEvent(entry, 1, OnEnterCombat)
RegisterCreatureEvent(entry, 2, OnLeaveCombat)
RegisterCreatureEvent(entry, 3, OnTargetDied)
RegisterCreatureEvent(entry, 4, OnDied)
RegisterCreatureEvent(entry, 5, OnSpawn)
Fixed Conflagration being casted without him in combat and added sound.
Next Up will be the Pumpkin Soliders

Thanks to Foereaper for this script. It's a bug fix to the Hallow's Eve Treats.
Code:
local PumpkinTreat = {
    Entry = 20557,
    Spells = {24924, 24925, 24708, 24927}, -- Define all the pumpkin spells here
}

function PumpkinTreat.OnUse(event, player, item, target)
    local t = PumpkinTreat["Spells"] -- Shorten the subtable to t
    
    for _, v in ipairs(t) do -- Loop through the spell table to see if the player has any of the spells applied
        if(player:HasAura(v)) then
            player:RemoveAura(v)
        end
    end
    
    player:CastSpell(player, t[math.random(#t)], true) -- Cast random spell on the player
end

RegisterItemEvent(PumpkinTreat.Entry, 2, PumpkinTreat.OnUse)
 
Last edited:

Rochet2

Moderator / Eluna Dev
Hmm. GetRelativePoint is not a global function and you use it like it would be and you have not defined a function by that name.
PS. Oh, I see. its never executed.
 

Render1982

Emulation Addict
Fixed 2 Bugs:
Conflagration being cast without him in combat.
Sounds are now functional (Had to use SoundIDs) Thanks to my friend for pointing this out! :)

And Added the fix (thanks to Foereaper) for the Hallow's Eve Treats

Updated Main Post as well
 
Last edited:
Top