Forum

> > CS2D > Scripts > Tibia script thread (Post tibia requests here)
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Tibia script thread (Post tibia requests here)

347 Antworten
Seite
Zum Anfang Vorherige 1 214 15 16 17 18 Nächste Zum Anfang

alt hurt monster

Salem97
User Off Offline

Zitieren
hurting a monster if shotting walls
i mean monster get hurt if u shot him outside monster area with walls

alt Re: Tibia script thread (Post tibia requests here)

Yates
Reviewer Off Offline

Zitieren
This file: file cs2d CS2DTibia - RPG [Fixed bugs] , fixes most of the known Tibia bugs.

Also to answer your PM, go to the config.lua and edit this table to insert weapon ranges.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
WEAPONRANGE = { -- range of cs2d weapons. e.g. [50] = 27 means wpnid 50 has range of 27 pixels. i should get around to change this to ingame ids some time
		[1] = 350, 
		[3] = 350, 
		[4] = 350, 
		[5] = 350, 
		[6] = 350, 
		[24] = 350, 
		[32] = 350, 
		[46] = 128, 
		[47] = 128, 
		[50] = 32, 
		[69] = 32, 
		[78] = 32, 
	},
Note: This table uses CS2D weapon ID's, NOT Tibia item ID's.

alt Re: Tibia script thread (Post tibia requests here)

Yates
Reviewer Off Offline

Zitieren
You're posting in the Tibia script request/help thread which means your post is in the wrong place which now means I can't help you if I don't have any code to look at.

Same goes for your PM by the way:
IMG:https://i.imgur.com/5q7fZLP.png


To Tibia or not to Tibia, it's not a question. It's just not a Tibia either.

alt speed dont work

Salem97
User Off Offline

Zitieren
when i use my wings its dont work speed is 40

but on my hud its show speed is 40 but wings dont give speed

and too all wings don't work so please help


Here Example of wing

Spoiler >

alt Re: Tibia script thread (Post tibia requests here)

VerteX
User Off Offline

Zitieren
Does anyone know on how to change runes' damage and heal?
Also can someone help me how to put cooldown on an infinite rune?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[100] = {
		name = "ember rune", 
		desc = "You may use it every x seconds", 
		r = 128, g = 0, b = 0, 
		action = {"cast","hold"}, 
		slot = 9, 
		fimage = "gfx/weiwen/rune.png", 
		func = {function(id,itemslot,itemid,equip)
			radiusmsg(player(id,"name") .. " casts a fireball rune.", player(id,"x"), player(id,"y"))
			explosion(player(id, "x"), player(id,"y"), 64, 15, id)
			local pos = player(id,"x") .. " " .. player(id,"y")
			parse("effect \"colorsmoke\" " .. pos .. " 100 64 255 128 0;")
			parse("effect \"colorsmoke\" " .. pos .. " 75 64 255 0 0")
			--destroyitem(id, itemslot, equip)
		end,equip},
	},

alt Re: Tibia script thread (Post tibia requests here)

Alpha Beta
User Off Offline

Zitieren
user VerteX hat geschrieben
Does anyone know on how to change runes' damage and heal?
Also can someone help me how to put cooldown on an infinite rune?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[100] = {
		name = "ember rune", 
		desc = "You may use it every x seconds", 
		r = 128, g = 0, b = 0, 
		action = {"cast","hold"}, 
		slot = 9, 
		fimage = "gfx/weiwen/rune.png", 
		func = {function(id,itemslot,itemid,equip)
			radiusmsg(player(id,"name") .. " casts a fireball rune.", player(id,"x"), player(id,"y"))
			explosion(player(id, "x"), player(id,"y"), 64, 15, id)
			local pos = player(id,"x") .. " " .. player(id,"y")
			parse("effect \"colorsmoke\" " .. pos .. " 100 64 255 128 0;")
			parse("effect \"colorsmoke\" " .. pos .. " 75 64 255 0 0")
			--destroyitem(id, itemslot, equip)
		end,equip},
	},


Well, look at the function-part of that piece of code. It says
1
explosion(player(id, "x"), player(id,"y"), 64, 15, id)

Which is >this< function in CS2D. So the damage is 15. If you put a negative value (like in the healing rune), you receive lifepoints instead.

And the cooldown stuff, not sure. I think that's not part of default Tibia, is it?

alt Re: Tibia script thread (Post tibia requests here)

Mami Tomoe
User Off Offline

Zitieren
user KenVo hat geschrieben
There might be some bugs so tell me if you find any.

config.lua

Add this code to the CONFIG table
1
2
--minutes delay until dropped items are automatically remove from the map (except items in houses)
	CLEANITEMSDELAY= 5,

functions.lua

1. Under function updateTileItems(x,y), find local heightoffset. Add this code under it:

1
2
local heightoffset = (height < MAXHEIGHT and height or MAXHEIGHT)*3
		item[4] = CONFIG.CLEANITEMSDELAY --this code

2. Add this function to functions.lua:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function cleanitems()
	for k,v in pairs (GROUNDITEMS) do
		local x,y,height
		for a,b in pairs (v) do
			for c,d in pairs (b) do
				d[4] = d[4] -1
				y=k
				x=a
				height=c
				if d[4] <= 0 and not TILEZONE[y][x].HOUSE then
					local item = d
					if item[1] == 1337 then
						if item[2] then freeimage(item[2]) end
						GROUNDITEMS[y][x][height] = nil
					else
						local tile = gettile(x*32, y*32)
						if tile.HEAL and ITEMS[item[1]].heal then
							tile.HEAL = tile.HEAL - ITEMS[item[1]].heal
							if tile.HEAL == 0 then
								tile.HEAL = nil
							end
						end
						if item[2] then freeimage(item[2]) end
						GROUNDITEMS[y][x][height] = nil
					end
				end
			end
		end
	end
	
end

hooks.lua
Find function EXPminute(). Add cleanitems() under it.

1
2
3
4
5
6
7
8
addhook("minute","EXPminute")
function EXPminute()
	cleanitems()
	MINUTES = MINUTES+1
	if game'sv_password' == '' and MINUTES%5 == 0 then
		saveserver()
	end
end


This doesn't work IDK if I did something wrong
1
2
3
4
LUA ERROR: sys/lua/cs2dtibia/functions.lua:345: attempt to index field '?' (a nil value)
 -> sys/lua/cs2dtibia/functions.lua:345: in function 'gettile'
 -> sys/lua/cs2dtibia/functions.lua:683: in function 'cleanitems'
 -> sys/lua/cs2dtibia/hooks.lua:242: in function <sys/lua/cs2dtibia/hooks.lua:241>

(for new people this is meant to despawn items after ? minutes)

I had to wait 5 minutes for the cooldown ( it felt a lot longer than 5 minutes )
Zum Anfang Vorherige 1 214 15 16 17 18 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht