• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Sam's Old Backpack Quest (looting bp) script

Indenpedens

Banned User
Joined
Nov 6, 2010
Messages
584
Reaction score
39
Location
Poland
Hello :)
This is fragment of Sam's Old Backpack Quest namely loot a backpack from orc in Orc Fortress area

so go to data\creaturescripts\scripts and create file bp.lua and paste this
Code:
local chance = 200 -- 1% * rateLoot
 
local t, r = {
	{ {x=32876, y=31707, z=2}, {x=32985, y=31807, z=6} },
 
	{ {x=32886, y=31727, z=8}, {x=32993, y=31806, z=9} },
 
	{ {x=32891, y=31751, z=7}, {x=32990, y=31796, z=7} },
	{ {x=32905, y=31797, z=7}, {x=32978, y=31804, z=7} },
	{ {x=32951, y=31714, z=7}, {x=32987, y=31750, z=7} },
	{ {x=32972, y=31704, z=7}, {x=32987, y=31713, z=7} },
 
	{ {x=32889, y=31749, z=7}, {x=32893, y=31753, z=7} },
	{ {x=32908, y=31749, z=7}, {x=32912, y=31750, z=7} },
	{ {x=32929, y=31749, z=7}, {x=32933, y=31750, z=7} },
	{ {x=32889, y=31770, z=7}, {x=32890, y=31774, z=7} },
	{ {x=32889, y=31793, z=7}, {x=32893, y=31797, z=7} },
	{ {x=32903, y=31802, z=7}, {x=32907, y=31806, z=7} },
	{ {x=32937, y=31805, z=7}, {x=32941, y=31806, z=7} },
	{ {x=32974, y=31805, z=7}, {x=32978, y=31806, z=7} }
}, getConfigValue('rateLoot')
 
function onDeath(cid, corpse)
	if math.random(100000) <= chance * r and isInArray({cid, nil}, getCreatureMaster(cid)) then
		local p = getThingPos(cid)
		for i = 1, #t do
			if isInRange(p, t[i][1], t[i][2]) then
				doAddContainerItem(corpse.uid, 3960)
				break
			end
		end
	end
	return true
end

now in creaturescripts.xml paste
Code:
<event type="death" name="bp" event="script" value="bp.lua"/>

then data\monster\Orcs open orc.xml and add this under </flags>
Code:
  <script>
		<event name="bp"/>
	</script>

notice: This area script is for 8.42 Orc fortess and 8.6+ Orc Fortess is a little bigger so u can edit area of looting
 
Last edited:
What is this ?
{ {x=32876, y=31707, z=2}, {x=32985, y=31807, z=6} },

{ {x=32886, y=31727, z=8}, {x=32993, y=31806, z=9} },

{ {x=32891, y=31751, z=7}, {x=32990, y=31796, z=7} },
{ {x=32905, y=31797, z=7}, {x=32978, y=31804, z=7} },
{ {x=32951, y=31714, z=7}, {x=32987, y=31750, z=7} },
{ {x=32972, y=31704, z=7}, {x=32987, y=31713, z=7} },

{ {x=32889, y=31749, z=7}, {x=32893, y=31753, z=7} },
{ {x=32908, y=31749, z=7}, {x=32912, y=31750, z=7} },
{ {x=32929, y=31749, z=7}, {x=32933, y=31750, z=7} },
{ {x=32889, y=31770, z=7}, {x=32890, y=31774, z=7} },
{ {x=32889, y=31793, z=7}, {x=32893, y=31797, z=7} },
{ {x=32903, y=31802, z=7}, {x=32907, y=31806, z=7} },
{ {x=32937, y=31805, z=7}, {x=32941, y=31806, z=7} },
{ {x=32974, y=31805, z=7}, {x=32978, y=31806, z=7} }
 
It's an array of coordinates found with the orc fortress of where the "orc" with the backpack can be found.
 
Why not just create another Orc file (orc2.xml) and name it "Orc". Then you can set up the loot.
Then do a rare and random spawn for this orc on globalevents.
 
Why not just create another Orc file (orc2.xml) and name it "Orc". Then you can set up the loot.
Then do a rare and random spawn for this orc on globalevents.

because on rl tibia players can loot sam's old bp from any orc but orc must be in Orc Fortres
 
Why not just create another Orc file (orc2.xml) and name it "Orc". Then you can set up the loot.
Then do a rare and random spawn for this orc on globalevents.

Then you would have to recreate the spawns all over the orc fort, good luck.
 
Then you would have to recreate the spawns all over the orc fort, good luck.

You can set the spawn position to your orc2 globalevent? Why would you recreate all spawns over the orc fortress?
 
Back
Top