how can i make the GODS have the talktype orange
example: if they say: hello or something else, the letter will show in orange not yellow
and how can i make this script repels you in horizontal:
and how can i make this script repels you in horizontal:
function getRepelTiles(cid)
local tile = {
{20, 3},
{40, 3},
{50, 3},
{80, 3},
{100, 3},
{120, 3}
}
table.sort(tile, function(a, b) return a[1] > b[1] end)
for _, t in ipairs(tile) do
if(getPlayerLevel(cid) >= t[1]) then
return t[2]
end
end
return tile[1][2]
end
function getNextPos(cid, tiles)
p = getCreaturePosition(cid)
x,y,z = p.x,p.y,p.z
local places = {
[0] = {x=x, y=(y-tiles), z=z, stackpos = 253},
[1] = {x=(x+tiles), y=y, z=z, stackpos = 253},
[2] = {x=x, y=(y+tiles), z=z, stackpos = 253},
[3] = {x=(x-tiles), y=y, z=z, stackpos = 253}}
return places[getPlayerLookDir(cid)]
end
function doRepel(cid, target, tiles)
if queryTileAddThing(cid, getNextPos(cid, 2)) == RETURNVALUE_NOERROR then
doCreatureSetLookDirection(target, getCreatureLookDirection(cid))
repeat
doTeleportThing(target, getNextPos(target, 1), true)
tiles = tiles-1
until tiles == 0 or queryTileAddThing(target, getNextPos(target, 1)) ~= RETURNVALUE_NOERROR
end
end
function onCastSpell(cid, var)
if exhaustion.check(cid, storage) == TRUE then
doPlayerSendCancel(cid, "You are exhausted["..exhaustion.get(cid, storage).."].")
return TRUE
else
exhaustion.set(cid, storage, 3)
end
targ = getThingfromPos(getNextPos(cid, 1))
if (isPlayer(targ.uid)) or (isMonster(targ.uid)) then
if queryTileAddThing(cid, getNextPos(cid, 2)) == RETURNVALUE_NOERROR then
if (isPlayer(targ.uid)) or (isMonster(targ.uid)) and getTilePzInfo(getCreaturePosition(cid)) == FALSE then
doRepel(cid, targ.uid, getRepelTiles(cid))
end
else
doPlayerSendCancel(cid, "Sorry not posible.")
end
else
doPlayerSendCancel(cid, "Sorry not posible.") end
end