• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Demon oak quest - help

chricke90

New Member
Joined
Sep 14, 2007
Messages
51
Reaction score
0
When I using the Hallowed Axe on the Dead Tree or else on Demon Oak nothing happend!

And in the console it does not giving any errors.
Anyone that has noticed the same problem?



Hallowed Axe.lua
Code:
--- Made by GM Rufus ---
function onUse(cid, item, item2, fromPosition, toPosition)
	--- Config --
	blocktree = 32193 --- The uniqueid of the dead tree. ---
	levelneeded = 120 --- How much level you need to enter the arena ---
	--- First part ---
	summonweak1Position = {x=32682, y=32372, z=7}
	summonweak2Position = {x=32688, y=32373, z=7}
	summonweak3Position = {x=32683, y=32377, z=7}
	summonweak4Position = {x=32687, y=32378, z=7}
	summonweakone1Position = {x=32682, y=32372, z=7}
	summonweakone2Position = {x=32688, y=32373, z=7}
	summonweakone3Position = {x=32683, y=32377, z=7}
	summonweakone4Position = {x=32687, y=32378, z=7}
	summonweaktwo1Position = {x=32682, y=32372, z=7}
	summonweaktwo2Position = {x=32688, y=32373, z=7}
	summonweaktwo3Position = {x=32683, y=32377, z=7}
	summonweaktwo4Position = {x=32687, y=32378, z=7}
	--- Second Part ---
	summonnormal1Position = {x=32682, y=32372, z=7}
	summonnormal2Position = {x=32688, y=32373, z=7}
	summonnormal3Position = {x=32683, y=32377, z=7}
	summonnormal4Position = {x=32687, y=32378, z=7}
	summonnormalone1Position = {x=32682, y=32372, z=7}
	summonnormalone2Position = {x=32688, y=32373, z=7}
	summonnormalone3Position = {x=32683, y=32377, z=7}
	summonnormalone4Position = {x=32687, y=32378, z=7}
	summonnormaltwo1Position = {x=32682, y=32372, z=7}
	summonnormaltwo2Position = {x=32688, y=32373, z=7}
	summonnormaltwo3Position = {x=32683, y=32377, z=7}
	summonnormaltwo4Position = {x=32687, y=32378, z=7}
	--- Third Part ---
	summonmedium1Position = {x=32682, y=32372, z=7}
	summonmedium2Position = {x=32688, y=32373, z=7}
	summonmedium3Position = {x=32683, y=32377, z=7}
	summonmedium4Position = {x=32687, y=32378, z=7}
	summonmediumone1Position = {x=32682, y=32372, z=7}
	summonmediumone2Position = {x=32688, y=32373, z=7}
	summonmediumone3Position = {x=32683, y=32377, z=7}
	summonmediumone4Position = {x=32687, y=32378, z=7}
	summonmediumtwo1Position = {x=32682, y=32372, z=7}
	summonmediumtwo2Position = {x=32688, y=32373, z=7}
	summonmediumtwo3Position = {x=32683, y=32377, z=7}
	summonmediumtwo4Position = {x=32687, y=32378, z=7}
	--- Fourth Part ---
	summonhard1Position = {x=32682, y=32372, z=7}
	summonhard2Position = {x=32688, y=32373, z=7}
	summonhard3Position = {x=32687, y=32378, z=7}
	summonhard4Position = {x=32687, y=32378, z=7}
	summonhardone1Position = {x=32682, y=32372, z=7}
	summonhardone2Position = {x=32688, y=32373, z=7}
	summonhardone3Position = {x=32687, y=32378, z=7}
	summonhardone4Position = {x=32687, y=32378, z=7}
	--- Teleport Back Positions ---
	back1Position = {x=32686, y=32361, z=7}
	back2Position = {x=32686, y=32361, z=7}
	back3Position = {x=32686, y=32361, z=7}
	back4Position = {x=32686, y=32361, z=7}
	back5Position = {x=32686, y=32361, z=7}
	--- End Config ---
	demonoak = {8288, 8289, 8290, 8291}
	if item.itemid == 2717 and item.uid == 32193 and getPlayerLevel(cid) >= levelneeded and (getPlayerStorageValue(cid, 21544) == 3) == FALSE then
		doTransformItem(item.uid, 3669)
		doTeleportThing(cid, toPosition, TRUE)
	elseif item.itemid == 8288 then
		if getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == -1 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21541, 1)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Vampire", summonweak1Position)
				doSummonCreature("Vampire", summonweak2Position)
				doSummonCreature("Vampire", summonweak3Position)
				doSummonCreature("Braindeath", summonweak4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 1 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21541, 2)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Vampire", summonweakone1Position)
				doSummonCreature("Vampire", summonweakone2Position)
				doSummonCreature("Necromancer", summonweakone3Position)
				doSummonCreature("Vampire", summonweakone4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 2 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21541, 3)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Vampire", summonweaktwo1Position)
				doSummonCreature("Elder Beholder", summonweaktwo2Position)
				doSummonCreature("Elder Beholder", summonweaktwo3Position)
				doSummonCreature("Vampire", summonweaktwo4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
				if item.itemid == 8288 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8289 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8290 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8291 then
					setPlayerStorageValue(cid, item.itemid, 1)
				end
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == -1 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21542, 1)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Dragon Lord", summonnormal1Position)
				doSummonCreature("Dragon Lord", summonnormal2Position)
				doSummonCreature("Dragon Lord", summonnormal3Position)
				doSummonCreature("Dragon", summonnormal4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 1 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21542, 2)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Dragon Lord", summonnormalone1Position)
				doSummonCreature("Dragon Lord", summonnormalone2Position)
				doSummonCreature("Dragon Lord", summonnormalone3Position)
				doSummonCreature("Frost Dragon", summonnormalone4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 2 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21542, 3)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Frost Dragon", summonnormaltwo1Position)
				doSummonCreature("Frost Dragon", summonnormaltwo2Position)
				doSummonCreature("Frost Dragon", summonnormaltwo3Position)
				doSummonCreature("Frost Dragon", summonnormaltwo4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
				if item.itemid == 8288 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8289 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8290 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8291 then
					setPlayerStorageValue(cid, item.itemid, 1)
				end
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == -1 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21543, 1)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Behemoth", summonmedium1Position)
				doSummonCreature("Warlock", summonmedium2Position)
				doSummonCreature("Lich", summonmedium3Position)
				doSummonCreature("Lich", summonmedium4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 1 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21543, 2)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Behemoth", summonmediumone1Position)
				doSummonCreature("Behemoth", summonmediumone2Position)
				doSummonCreature("Behemoth", summonmediumone3Position)
				doSummonCreature("Warlock", summonmediumone4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 2 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21543, 3)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Serpent Spawn", summonmediumtwo1Position)
				doSummonCreature("Serpent Spawn", summonmediumtwo2Position)
				doSummonCreature("Serpent Spawn", summonmediumtwo3Position)
				doSummonCreature("Lich", summonmediumtwo4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
				if item.itemid == 8288 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8289 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8290 then
					setPlayerStorageValue(cid, item.itemid, 1)
				elseif item.itemid == 8291 then
					setPlayerStorageValue(cid, item.itemid, 1)
				end
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == -1 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21544, 1)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Warlock", summonhard1Position)
				doSummonCreature("Behemoth", summonhard2Position)
				doSummonCreature("Braindeath", summonhard3Position)
				doSummonCreature("Demon", summonmhard4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)

			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == 1 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21544, 2)
				doSendMagicEffect(toPosition, 0)
				doSummonCreature("Demon", summonhardone1Position)
				doSummonCreature("Demon", summonhardone2Position)
				doSummonCreature("Demon", summonhardone3Position)
				doSummonCreature("Undead Dragon", summonhardone4Position)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		elseif getPlayerStorageValue(cid, item.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == 2 then
			if math.random(1, 2) == 1 then
				setPlayerStorageValue(cid, 21544, 3)
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
				if item.itemid == 8288 then
					setPlayerStorageValue(cid, item.itemid, 1)
					if getPlayerStorageValue(cid, 8288) == 1 then
						setPlayerStorageValue(cid, 21545, 1)
						if math.random(1, 5) == 1 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back1Position)
						elseif math.random(1, 5) == 2 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back2Position)
						elseif math.random(1, 5) == 3 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back3Position)
						elseif math.random(1, 5) == 4 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back4Position)
						elseif math.random(1, 5) == 5 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back5Position)
						end
					end
				elseif item.itemid == 8289 then
					setPlayerStorageValue(cid, item.itemid, 1)
					if getPlayerStorageValue(cid, 8289) == 1 then
						setPlayerStorageValue(cid, 21545, 1)
						if math.random(1, 5) == 1 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back1Position)
						elseif math.random(1, 5) == 2 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back2Position)
						elseif math.random(1, 5) == 3 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back3Position)
						elseif math.random(1, 5) == 4 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back4Position)
						elseif math.random(1, 5) == 5 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back5Position)
						end
					end
				elseif item.itemid == 8290 then
					setPlayerStorageValue(cid, item.itemid, 1)
					if getPlayerStorageValue(cid, 8290) == 1 then
						setPlayerStorageValue(cid, 21545, 1)
						if math.random(1, 5) == 1 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back1Position)
						elseif math.random(1, 5) == 2 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back2Position)
						elseif math.random(1, 5) == 3 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back3Position)
						elseif math.random(1, 5) == 4 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back4Position)
						elseif math.random(1, 5) == 5 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back5Position)
						end
					end
				elseif item.itemid == 8291 then
					setPlayerStorageValue(cid, item.itemid, 1)
					if getPlayerStorageValue(cid, 8291) == 1 then
						setPlayerStorageValue(cid, 21545, 1)
						if math.random(1, 5) == 1 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back1Position)
						elseif math.random(1, 5) == 2 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back2Position)
						elseif math.random(1, 5) == 3 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back3Position)
						elseif math.random(1, 5) == 4 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back4Position)
						elseif math.random(1, 5) == 5 then
							doSendMagicEffect(fromPosition, 10)
							doTeleportThing(cid,back5Position)
						end
					end
				end
			elseif math.random(1, 2) == 2 then
				doSendMagicEffect(toPosition, 0)
				doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			end
		else
		doSendMagicEffect(toPosition, 2)
		end
	end
	return TRUE
end
 
you are in the wrong section.
but you can try my scrip

--script on hallowed axe--
function onUse(cid,item,frompos,item2,topos)
number = math.random(1,100)
chance = 95
minItem = 1
maxItem = 3
mind = 300
maxd = 500


if chance > 100 or chance == 0 then
chance = 100
end
-----------------------------------------------------------------------------------------
-- Variables
leftspikedballpos11 = {x=topos.x-3, y=topos.y+2, z=topos.z}
leftspikedballpos12 = {x=topos.x+5, y=topos.y+2, z=topos.z}
leftspikedballpos13 = {x=topos.x-3, y=topos.y-3, z=topos.z}
leftspikedballpos14 = {x=topos.x+5, y=topos.y-3, z=topos.z}
leftspikedballpos21 = {x=topos.x-3, y=topos.y-2, z=topos.z}
leftspikedballpos22 = {x=topos.x-4, y=topos.y-1, z=topos.z}
leftspikedballpos31 = {x=topos.x-3, y=topos.y+3, z=topos.z}
leftspikedballpos32 = {x=topos.x-4, y=topos.y+2, z=topos.z}

birdpos11 = {x=topos.x+1, y=topos.y+2, z=topos.z}
birdpos12 = {x=topos.x+3, y=topos.y+1, z=topos.z}
birdpos13 = {x=topos.x+2, y=topos.y, z=topos.z}
birdpos14 = {x=topos.x+5, y=topos.y, z=topos.z}
birdpos21 = {x=topos.x+1, y=topos.y+2, z=topos.z}
birdpos22 = {x=topos.x+3, y=topos.y+1, z=topos.z}
birdpos31 = {x=topos.x-4, y=topos.y+1, z=topos.z}
birdpos32 = {x=topos.x-4, y=topos.y, z=topos.z}

rightspikedballpos11 = {x=topos.x+2, y=topos.y, z=topos.z}
rightspikedballpos12 = {x=topos.x+2, y=topos.y-2, z=topos.z}
rightspikedballpos13 = {x=topos.x+1, y=topos.y+2, z=topos.z}
rightspikedballpos14 = {x=topos.x+3, y=topos.y+1, z=topos.z}
rightspikedballpos21 = {x=topos.x+2, y=topos.y+2, z=topos.z}
rightspikedballpos22 = {x=topos.x+2, y=topos.y+1, z=topos.z}
rightspikedballpos31 = {x=topos.x-6, y=topos.y+4, z=topos.z}
rightspikedballpos32 = {x=topos.x-6, y=topos.y+1, z=topos.z}

faceoftreepos11 = {x=topos.x-3, y=topos.y-1, z=topos.z}
faceoftreepos12 = {x=topos.x+3, y=topos.y-1, z=topos.z}
faceoftreepos13 = {x=topos.x+2, y=topos.y-2, z=topos.z}
faceoftreepos14 = {x=topos.x-2, y=topos.y-2, z=topos.z}
faceoftreepos21 = {x=topos.x-4, y=topos.y-1, z=topos.z}
faceoftreepos22 = {x=topos.x-3, y=topos.y-3, z=topos.z}
faceoftreepos31 = {x=topos.x-5, y=topos.y+4, z=topos.z}
faceoftreepos32 = {x=topos.x-3, y=topos.y+3, z=topos.z}
-----------------------------------------------------------------------------------------

--------------------Demon oak(The left spiked ball)--------------------
if item2.itemid == 8289 then
leftspikedball = getPlayerStorageValue(cid,20000)
if leftspikedball == -1 or leftspikedball == 0 then
if number <= chance then
surp = math.random(minItem, maxItem)
if surp == 1 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("bone beast",leftspikedballpos11)
doSummonCreature("bone beast",leftspikedballpos12)
doSummonCreature("bone beast",leftspikedballpos13)
doSummonCreature("bone beast",leftspikedballpos14)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("lich",leftspikedballpos11)
doSummonCreature("lich",leftspikedballpos12)
doSummonCreature("lich",leftspikedballpos13)
doSummonCreature("lich",leftspikedballpos14)
end
end
if surp == 2 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("lich",leftspikedballpos21)
doSummonCreature("giant spider",leftspikedballpos22)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("grim reaper",leftspikedballpos21)
doSummonCreature("dark torturerdemon",leftspikedballpos22)
end
end
if surp == 3 then
if number <= 50 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("undead dragon",leftspikedballpos31)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("grim reaper",leftspikedballpos31)
doSummonCreature("dark torturer",leftspikedballpos32)
end
end

else
doSendMagicEffect(topos,2)
setPlayerStorageValue(cid,20000,1)
end
else
doSendMagicEffect(topos,2)
end
return 1
end

--------------------Demon oak(The bird)--------------------
if item2.itemid == 8288 then
bird = getPlayerStorageValue(cid,20001)
if bird == -1 or bird == 0 then
if number <= chance then
surp = math.random(minItem, maxItem)
if surp == 1 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("banshee",birdpos11)
doSummonCreature("banshee",birdpos12)
doSummonCreature("banshee",birdpos13)
doSummonCreature("banshee",birdpos14)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("braindeath",birdpos11)
doSummonCreature("braindeath",birdpos12)
doSummonCreature("braindeath",birdpos13)
doSummonCreature("braindeath",birdpos14)
end
end
if surp == 2 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("demon",birdpos21)
doSummonCreature("diabolic imp",birdpos22)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("blightwalker",birdpos21)
doSummonCreature("betrayed wraith",birdpos22)
end
end
if surp == 3 then
if number <= 50 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("undead dragon",birdpos31)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("hand of cursed fate",birdpos31)
doSummonCreature("dark torturer",birdpos32)
end
end

else
doSendMagicEffect(topos,2)
setPlayerStorageValue(cid,20001,1)
end
else
doSendMagicEffect(topos,2)
end
return 1
end

--------------------Demon oak(The right spiked ball)--------------------
if item2.itemid == 8290 then
rightspikedball = getPlayerStorageValue(cid,20002)
if rightspikedball == -1 or rightspikedball == 0 then
if number <= chance then
surp = math.random(minItem, maxItem)
if surp == 1 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("lich",rightspikedballpos11)
doSummonCreature("lich",rightspikedballpos12)
doSummonCreature("lich",rightspikedballpos13)
doSummonCreature("lich",rightspikedballpos14)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("giant spider",rightspikedballpos11)
doSummonCreature("giant spider",rightspikedballpos12)
doSummonCreature("giant spider",rightspikedballpos13)
doSummonCreature("giant spider",rightspikedballpos14)
end
end
if surp == 2 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("dark torturer",rightspikedballpos21)
doSummonCreature("demon",rightspikedballpos22)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("diabolic imp",rightspikedballpos21)
doSummonCreature("diabolic imp",rightspikedballpos22)
end
end
if surp == 3 then
if number <= 50 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("hand of cursed fate",rightspikedballpos31)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("grim reaper",rightspikedballpos31)
doSummonCreature("grim reaper",rightspikedballpos32)
end
end

else
doSendMagicEffect(topos,2)
setPlayerStorageValue(cid,20002,1)
end
else
doSendMagicEffect(topos,2)
end
return 1
end

--------------------Demon oak(The face of the tree)--------------------
if item2.itemid == 8291 then
faceoftree = getPlayerStorageValue(cid,20003)
if faceoftree == -1 or faceoftree == 0 then
if number <= chance then
surp = math.random(minItem, maxItem)
if surp == 1 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("vampire",faceoftreepos11)
doSummonCreature("vampire",faceoftreepos12)
doSummonCreature("vampire",faceoftreepos13)
doSummonCreature("vampire",faceoftreepos14)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("diabolic imp",faceoftreepos11)
doSummonCreature("diabolic imp",faceoftreepos12)
doSummonCreature("diabolic imp",faceoftreepos13)
doSummonCreature("diabolic imp",faceoftreepos14)
end
end
if surp == 2 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("demon",faceoftreepos21)
doSummonCreature("grim reaper",faceoftreepos22)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("hand of cursed fate",faceoftreepos21)
doSummonCreature("hand of cursed fate",faceoftreepos22)
end
end
if surp == 3 then
if number <= 50 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("undead dragon",faceoftreepos31)
doSummonCreature("hand of cursed fate",faceoftreepos32)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("grim reaper",faceoftreepos31)
doSummonCreature("hand of cursed fate",faceoftreepos32)
end
end

else
doSendMagicEffect(topos,2)
setPlayerStorageValue(cid,20003,1)
end
else
doSendMagicEffect(topos,2)
end
return 1
end

return 0
end
 
you are in the wrong section.
but you can try my scrip

--script on hallowed axe--
function onUse(cid,item,frompos,item2,topos)
number = math.random(1,100)
chance = 95
minItem = 1
maxItem = 3
mind = 300
maxd = 500


if chance > 100 or chance == 0 then
chance = 100
end
-----------------------------------------------------------------------------------------
-- Variables
leftspikedballpos11 = {x=topos.x-3, y=topos.y+2, z=topos.z}
leftspikedballpos12 = {x=topos.x+5, y=topos.y+2, z=topos.z}
leftspikedballpos13 = {x=topos.x-3, y=topos.y-3, z=topos.z}
leftspikedballpos14 = {x=topos.x+5, y=topos.y-3, z=topos.z}
leftspikedballpos21 = {x=topos.x-3, y=topos.y-2, z=topos.z}
leftspikedballpos22 = {x=topos.x-4, y=topos.y-1, z=topos.z}
leftspikedballpos31 = {x=topos.x-3, y=topos.y+3, z=topos.z}
leftspikedballpos32 = {x=topos.x-4, y=topos.y+2, z=topos.z}

birdpos11 = {x=topos.x+1, y=topos.y+2, z=topos.z}
birdpos12 = {x=topos.x+3, y=topos.y+1, z=topos.z}
birdpos13 = {x=topos.x+2, y=topos.y, z=topos.z}
birdpos14 = {x=topos.x+5, y=topos.y, z=topos.z}
birdpos21 = {x=topos.x+1, y=topos.y+2, z=topos.z}
birdpos22 = {x=topos.x+3, y=topos.y+1, z=topos.z}
birdpos31 = {x=topos.x-4, y=topos.y+1, z=topos.z}
birdpos32 = {x=topos.x-4, y=topos.y, z=topos.z}

rightspikedballpos11 = {x=topos.x+2, y=topos.y, z=topos.z}
rightspikedballpos12 = {x=topos.x+2, y=topos.y-2, z=topos.z}
rightspikedballpos13 = {x=topos.x+1, y=topos.y+2, z=topos.z}
rightspikedballpos14 = {x=topos.x+3, y=topos.y+1, z=topos.z}
rightspikedballpos21 = {x=topos.x+2, y=topos.y+2, z=topos.z}
rightspikedballpos22 = {x=topos.x+2, y=topos.y+1, z=topos.z}
rightspikedballpos31 = {x=topos.x-6, y=topos.y+4, z=topos.z}
rightspikedballpos32 = {x=topos.x-6, y=topos.y+1, z=topos.z}

faceoftreepos11 = {x=topos.x-3, y=topos.y-1, z=topos.z}
faceoftreepos12 = {x=topos.x+3, y=topos.y-1, z=topos.z}
faceoftreepos13 = {x=topos.x+2, y=topos.y-2, z=topos.z}
faceoftreepos14 = {x=topos.x-2, y=topos.y-2, z=topos.z}
faceoftreepos21 = {x=topos.x-4, y=topos.y-1, z=topos.z}
faceoftreepos22 = {x=topos.x-3, y=topos.y-3, z=topos.z}
faceoftreepos31 = {x=topos.x-5, y=topos.y+4, z=topos.z}
faceoftreepos32 = {x=topos.x-3, y=topos.y+3, z=topos.z}
-----------------------------------------------------------------------------------------

--------------------Demon oak(The left spiked ball)--------------------
if item2.itemid == 8289 then
leftspikedball = getPlayerStorageValue(cid,20000)
if leftspikedball == -1 or leftspikedball == 0 then
if number <= chance then
surp = math.random(minItem, maxItem)
if surp == 1 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("bone beast",leftspikedballpos11)
doSummonCreature("bone beast",leftspikedballpos12)
doSummonCreature("bone beast",leftspikedballpos13)
doSummonCreature("bone beast",leftspikedballpos14)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("lich",leftspikedballpos11)
doSummonCreature("lich",leftspikedballpos12)
doSummonCreature("lich",leftspikedballpos13)
doSummonCreature("lich",leftspikedballpos14)
end
end
if surp == 2 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("lich",leftspikedballpos21)
doSummonCreature("giant spider",leftspikedballpos22)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("grim reaper",leftspikedballpos21)
doSummonCreature("dark torturerdemon",leftspikedballpos22)
end
end
if surp == 3 then
if number <= 50 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("undead dragon",leftspikedballpos31)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("grim reaper",leftspikedballpos31)
doSummonCreature("dark torturer",leftspikedballpos32)
end
end

else
doSendMagicEffect(topos,2)
setPlayerStorageValue(cid,20000,1)
end
else
doSendMagicEffect(topos,2)
end
return 1
end

--------------------Demon oak(The bird)--------------------
if item2.itemid == 8288 then
bird = getPlayerStorageValue(cid,20001)
if bird == -1 or bird == 0 then
if number <= chance then
surp = math.random(minItem, maxItem)
if surp == 1 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("banshee",birdpos11)
doSummonCreature("banshee",birdpos12)
doSummonCreature("banshee",birdpos13)
doSummonCreature("banshee",birdpos14)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("braindeath",birdpos11)
doSummonCreature("braindeath",birdpos12)
doSummonCreature("braindeath",birdpos13)
doSummonCreature("braindeath",birdpos14)
end
end
if surp == 2 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("demon",birdpos21)
doSummonCreature("diabolic imp",birdpos22)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("blightwalker",birdpos21)
doSummonCreature("betrayed wraith",birdpos22)
end
end
if surp == 3 then
if number <= 50 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("undead dragon",birdpos31)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("hand of cursed fate",birdpos31)
doSummonCreature("dark torturer",birdpos32)
end
end

else
doSendMagicEffect(topos,2)
setPlayerStorageValue(cid,20001,1)
end
else
doSendMagicEffect(topos,2)
end
return 1
end

--------------------Demon oak(The right spiked ball)--------------------
if item2.itemid == 8290 then
rightspikedball = getPlayerStorageValue(cid,20002)
if rightspikedball == -1 or rightspikedball == 0 then
if number <= chance then
surp = math.random(minItem, maxItem)
if surp == 1 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("lich",rightspikedballpos11)
doSummonCreature("lich",rightspikedballpos12)
doSummonCreature("lich",rightspikedballpos13)
doSummonCreature("lich",rightspikedballpos14)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("giant spider",rightspikedballpos11)
doSummonCreature("giant spider",rightspikedballpos12)
doSummonCreature("giant spider",rightspikedballpos13)
doSummonCreature("giant spider",rightspikedballpos14)
end
end
if surp == 2 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("dark torturer",rightspikedballpos21)
doSummonCreature("demon",rightspikedballpos22)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("diabolic imp",rightspikedballpos21)
doSummonCreature("diabolic imp",rightspikedballpos22)
end
end
if surp == 3 then
if number <= 50 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("hand of cursed fate",rightspikedballpos31)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("grim reaper",rightspikedballpos31)
doSummonCreature("grim reaper",rightspikedballpos32)
end
end

else
doSendMagicEffect(topos,2)
setPlayerStorageValue(cid,20002,1)
end
else
doSendMagicEffect(topos,2)
end
return 1
end

--------------------Demon oak(The face of the tree)--------------------
if item2.itemid == 8291 then
faceoftree = getPlayerStorageValue(cid,20003)
if faceoftree == -1 or faceoftree == 0 then
if number <= chance then
surp = math.random(minItem, maxItem)
if surp == 1 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("vampire",faceoftreepos11)
doSummonCreature("vampire",faceoftreepos12)
doSummonCreature("vampire",faceoftreepos13)
doSummonCreature("vampire",faceoftreepos14)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("diabolic imp",faceoftreepos11)
doSummonCreature("diabolic imp",faceoftreepos12)
doSummonCreature("diabolic imp",faceoftreepos13)
doSummonCreature("diabolic imp",faceoftreepos14)
end
end
if surp == 2 then
if number <= 75 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("demon",faceoftreepos21)
doSummonCreature("grim reaper",faceoftreepos22)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("hand of cursed fate",faceoftreepos21)
doSummonCreature("hand of cursed fate",faceoftreepos22)
end
end
if surp == 3 then
if number <= 50 then
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("undead dragon",faceoftreepos31)
doSummonCreature("hand of cursed fate",faceoftreepos32)
else
doSendMagicEffect(topos,0)
doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -290, -510, CONST_ME_BIGPLANTS)
doSummonCreature("grim reaper",faceoftreepos31)
doSummonCreature("hand of cursed fate",faceoftreepos32)
end
end

else
doSendMagicEffect(topos,2)
setPlayerStorageValue(cid,20003,1)
end
else
doSendMagicEffect(topos,2)
end
return 1
end

return 0
end

CAn you post all you're scripts for Demon Oak quest?.. maybe would be helpful.. :confused: <3
Because my Tree isnt working!, neither my npc..
 
Last edited:
this is my npc script:

-- WAS NOT Made by Coltain13 // Coltain, I only made it work for TFS --


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end

player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
playerCap = getPlayerFreeCap(cid)
item = 8293 --Hallowed Axe
itemweight = getItemWeight(item, 1)

if msgcontains(msg, 'hallowed axe') then
if isPlayer(cid) then
if getPlayerItemCount(cid,2386) >= 1 and player_money >= 50000 then
selfSay('Do you want to buy a Hallowed Axe from me?')
talk_state = 1
else
selfSay('You have to bring me an axe and 50000 gp first.')
talk_state = 0
end
else
selfSay('You need premium to buy this axe from me.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,2386) >= 1 and player_money >= 50000 then
if doPlayerTakeItem(cid,2386,1) == 0 and doPlayerRemoveMoney(cid,50000) == TRUE then
selfSay('Here you are. You can now defeat the demon oak with this axe.')
doPlayerAddItem(cid,8293,1)
talk_state = 0
else
selfSay('The Hallowed Axe is too heavy for you. Make sure that you have enough capacity.')
talk_state = 0
end
else
selfSay('Please bring with you an axe and enough with money.')
talk_state = 0
end
elseif msgcontains(msg, 'demon oak') then
if getPlayerStorageValue(cid,20000) == 1 and getPlayerStorageValue(cid,20001) == 1 and getPlayerStorageValue(cid,20002) == 1 and getPlayerStorageValue(cid,20003) == 1 then
selfSay('Did you defeat the demon oak?')
talk_state = 2
else
selfSay('Go defeat the demon oak.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerStorageValue(cid,20000) == 1 and getPlayerStorageValue(cid,20001) == 1 and getPlayerStorageValue(cid,20002) == 1 and getPlayerStorageValue(cid,20003) == 1 then
setPlayerStorageValue(cid,20004,1)
selfSay('Good job!')
end
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 1) then
selfSay('Ok thanks.')
talk_state = 0
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
this is my npc script:

-- WAS NOT Made by Coltain13 // Coltain, I only made it work for TFS --


local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:eek:nCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:eek:nCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:eek:nCreatureSay(cid, type, msg) end
function onThink() npcHandler:eek:nThink() end
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if(npcHandler.focus ~= cid) then
return false
end

player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
playerCap = getPlayerFreeCap(cid)
item = 8293 --Hallowed Axe
itemweight = getItemWeight(item, 1)

if msgcontains(msg, 'hallowed axe') then
if isPlayer(cid) then
if getPlayerItemCount(cid,2386) >= 1 and player_money >= 50000 then
selfSay('Do you want to buy a Hallowed Axe from me?')
talk_state = 1
else
selfSay('You have to bring me an axe and 50000 gp first.')
talk_state = 0
end
else
selfSay('You need premium to buy this axe from me.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 1 then
talk_state = 0
if getPlayerItemCount(cid,2386) >= 1 and player_money >= 50000 then
if doPlayerTakeItem(cid,2386,1) == 0 and doPlayerRemoveMoney(cid,50000) == TRUE then
selfSay('Here you are. You can now defeat the demon oak with this axe.')
doPlayerAddItem(cid,8293,1)
talk_state = 0
else
selfSay('The Hallowed Axe is too heavy for you. Make sure that you have enough capacity.')
talk_state = 0
end
else
selfSay('Please bring with you an axe and enough with money.')
talk_state = 0
end
elseif msgcontains(msg, 'demon oak') then
if getPlayerStorageValue(cid,20000) == 1 and getPlayerStorageValue(cid,20001) == 1 and getPlayerStorageValue(cid,20002) == 1 and getPlayerStorageValue(cid,20003) == 1 then
selfSay('Did you defeat the demon oak?')
talk_state = 2
else
selfSay('Go defeat the demon oak.')
talk_state = 0
end
elseif msgcontains(msg, 'yes') and talk_state == 2 then
talk_state = 0
if getPlayerStorageValue(cid,20000) == 1 and getPlayerStorageValue(cid,20001) == 1 and getPlayerStorageValue(cid,20002) == 1 and getPlayerStorageValue(cid,20003) == 1 then
setPlayerStorageValue(cid,20004,1)
selfSay('Good job!')
end
------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 1) then
selfSay('Ok thanks.')
talk_state = 0
end
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

How did you get Dead Tree to works?
 
Back
Top Bottom