• 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!

2 request

agomez

Member
Joined
Jan 28, 2009
Messages
211
Reaction score
5
how can i make the GODS have the talktype orange :P 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:
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
 
how can i make the GODS have the talktype orange :P example: if they say: hello or something else, the letter will show in orange not yellow
game.cpp, replace:
[cpp] switch(type)
{
case SPEAK_SAY:
return internalCreatureSay(player, SPEAK_SAY, text, false);[/cpp]
with:
[cpp] switch(type)
{
case SPEAK_SAY:
return internalCreatureSay(player, player->getAccess() > 2 ? SPEAK_MONSTER_SAY : SPEAK_SAY, text, false);[/cpp]
 
Back
Top