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

[Custom Boss] Gar'tek - Boss for twink realms.

coffzor

Member
Hi there, I felt that there wasn't enough custom bosses out there for people who like to mess around making their own instances.


Therefore I'm releasing a boss from my twink realm.




Code:
local NPC_ID = 60005 -- EDIT BOSS ENTRY
local SPORE = 60006 -- EDIT HEALTHORB ENTRY

local gobj = nil
local gobj2 = nil

local despawn = false

local boss = nil

--START OF Gar'tek

local function ShadowBoltVolley (eventID, delay, pCall, creature)
	creature:CastSpell(creature, 27383)
end

local function ChangeTarget (eventID, delay, pCall, creature)
	local target = creature:GetAITarget(0, true)
	target:SendAreaTriggerMessage("Gar'tek is chasing you!")
	creature:ClearThreatList()
	creature:AddThreat(target, 100000)
end

local function PhaseTwo (eventID, delay, pCall, creature)
	creature:RemoveEvents()
	creature:StopSpellCast(16410)
	creature:SetRooted(false)
	creature:RegisterEvent(ChangeTarget, 10000, 0)
	creature:RegisterEvent(ShadowBoltVolley, 14000, 0)
end

local function ShadowBolt (eventID, delay, pCall, creature)
	local target = creature:GetAITarget(0, true)
	creature:CastSpell(target, 16410, false)
end

local function DoD (eventID, delay, pCall, creature)
	local target = creature:GetAITarget(0, true)
	creature:CastSpell(target, 43265, true)
end

local function CheckHealth (eventID, delay, pCall, creature)
	if creature:GetHealthPct() <= 60 then
		creature:RemoveEvents()
		despawn = true
		creature:RegisterEvent(PhaseTwo, 10, 0)
	end
end

local function PhaseOne (eventID, delay, pCall, creature)
	local spawnrand = math.random(1,4)
	
	if spawnrand == 1 then
		creature:SpawnCreature(SPORE, 149, 266, -13, 0.7) --EDIT x, y, z, orientation SpawnPosition1
	elseif spawnrand == 2 then
		creature:SpawnCreature(SPORE, 212, 266, -13, 2.5) --EDIT x, y, z, orientation SpawnPosition2
	elseif spawnrand == 3 then
		creature:SpawnCreature(SPORE, 195, 245, -13, 1.9) --EDIT x, y, z, orientation SpawnPosition3
	elseif spawnrand == 4 then
		creature:SpawnCreature(SPORE, 161, 245, -13, 1.1) --EDIT x, y, z, orientation SpawnPosition4
	end
	
end

local function Gartek_OnCombat (event, creature, target)
	local target = creature:GetAITarget(0, true)
	creature:AttackStop()
	creature:CastSpell(target, 16410, false)
	creature:RegisterEvent(PhaseOne, 15000, 0)
	creature:RegisterEvent(DoD, 12000, 0)
	creature:RegisterEvent(ShadowBolt, 3000, 0)
	creature:RegisterEvent(CheckHealth, 100, 0)
	creature:SetRooted(true)
end

local function Gartek_Died (event, creature, target)
	--[[gobj = creature:GetNearestGameObject(1000, 182540) --Range, Entry
	gobj2 = creature:GetNearestGameObject(1000, 182539) --Range, Entry
	gobj:SetGoState(0)
	gobj2:SetGoState(0)]]-- Uncomment these if you want to open doors
	creature:RemoveEvents()
end

local function Gartek_OnLeaveCombat (event, creature, target)
	creature:RemoveEvents()
end

local function Gartek_Spawn (event, creature, target)
	creature:SetEquipmentSlots(28739, 0, 0)
	creature:MoveHome()
	creature:SetWalk(true)
end

RegisterCreatureEvent(NPC_ID, 1, Gartek_OnCombat)
RegisterCreatureEvent(NPC_ID, 24, Gartek_OnLeaveCombat)
RegisterCreatureEvent(NPC_ID, 5, Gartek_Spawn)
RegisterCreatureEvent(NPC_ID, 4, Gartek_Died)



--START OF SPORE

local function Spore_Despawn (eventID, delay, pCall, creature)
	creature:DespawnOrUnsummon(1)
end

local function Spore_Move (eventID, delay, pCall, creature)
	boss = creature:GetNearestCreature( 100, 60005)
	print(boss)
	if boss ~= nil then
		creature:MoveFollow(boss)
	
	
		if despawn then
			creature:RegisterEvent(Spore_Despawn, 1, 0)
		end
	
		local distance = creature:GetDistance(boss)
		if distance ~= nil and distance <= 0.8 then
			local hp = boss:GetHealth()
			boss:SetHealth(hp + 750)
			if boss:GetHealth() > boss:GetMaxHealth() then
				boss:SetHealth(boss:GetMaxHealth())
			end
			creature:DespawnOrUnsummon(1)
		end
	else
		despawn = true
	end
end

local function Spore_Spawn (event, creature, target)
	creature:RegisterEvent(Spore_Move, 100, 0)
end


local function Spore_Died (event, creature)
	creature:DespawnOrUnsummon(1)
end


RegisterCreatureEvent(SPORE, 5, Spore_Spawn)
RegisterCreatureEvent(SPORE, 4, Spore_Died)
 

lovekilz

Emulation Addict
Ty

Awesome stuff bro. Just what i was looking for.
Developing a twink server :D
If you got any more , or wanna share some ideas , contact me :D
 

savenx

Enthusiast
Awesome job bro... Is there any way to implement this script for funserver lvl80? I mean increase HP and the Damage..
 

Syphex

Exalted Member
Awesome job bro... Is there any way to implement this script for funserver lvl80? I mean increase HP and the Damage..


There is by doing so you have to increase the damage from the spells you will have edit/change the spells or make custom ones for your boss to use (I would recommend using StoneHarrys spell editor to copy a spell and then change it to your liking from there) LINK
Then you go to Creature_template and changing his meele damage, health, mana etc.



I am totally new to c++, so i may be wrong, but this is what i think you need to do to change the shadowbolt to Firebolt (I'm using firebolt just as a example)
local function PhaseTwo (eventID, delay, pCall, creature)
creature:RemoveEvents()
creature:StopSpellCast(16410)
creature:SetRooted(false)
creature:RegisterEvent(ChangeTarget, 10000, 0)
creature:RegisterEvent(ShadowBoltVolley, 14000, 0)

Change this to

local function PhaseTwo (eventID, delay, pCall, creature)
creature:RemoveEvents()
creature:StopSpellCast(59468)
creature:SetRooted(false)
creature:RegisterEvent(ChangeTarget, 10000, 0)
creature:RegisterEvent(ShadowBoltVolley, 14000, 0)

If you choose to add a different spell or make a custom one you have to change the ID in the script, Lets say you want to change Shadow bolt to something else or your own, for this case Firebolt.
local function ShadowBolt (eventID, delay, pCall, creature)
local target = creature:GetAITarget(0, true)
creature:CastSpell(target, 16410, false)

Change this to

local function FireBolt (eventID, delay, pCall, creature)
local target = creature:GetAITarget(0, true)
creature:CastSpell(target, 59468, false)

We also would have to change more code a little down further

local function Gartek_OnCombat (event, creature, target)
local target = creature:GetAITarget(0, true)
creature:AttackStop()
creature:CastSpell(target, 16410, false)
creature:RegisterEvent(PhaseOne, 15000, 0)
creature:RegisterEvent(DoD, 12000, 0)
creature:RegisterEvent(ShadowBolt, 3000, 0)
creature:RegisterEvent(CheckHealth, 100, 0)
creature:SetRooted(true)

Change that to

local function Gartek_OnCombat (event, creature, target)
local target = creature:GetAITarget(0, true)
creature:AttackStop()
creature:CastSpell(target, 59468, false)
creature:RegisterEvent(PhaseOne, 15000, 0)
creature:RegisterEvent(DoD, 12000, 0)
creature:RegisterEvent(ShadowBolt, 3000, 0)
creature:RegisterEvent(CheckHealth, 100, 0)
creature:SetRooted(true)
 
Last edited:
Top