Fix/Patch forgottenl 0.4 rev 3884

heba

Veteran OT User
Joined
Aug 5, 2011
Messages
1,363
Best answers
13
Reaction score
171
This sourece for tibia 8.60 0.4 {Windows}

Download link
http://www.mediafire.com/download/kt31zo5x8oq8k4x/reall+map+source+with+full+edite.rar

Edite
1: Player walk { dp tile 11063},

2:Nomoveitems {done},

3: Ghost spell {done},

4:war shield system {done}, Use war.lua i add down

5: cast system {done}, set this in confing.lua {enableCast = true}

6: Show player level and vocation in login {done},

7: conjure runes on your bag {done}

Edite maybe you will need it

Open level for 10 million

Player.h

change
static uint64_t getExpForLevel(uint32_t lv)
to
Code:
static uint64_t getExpForLevel(uint32_t lv)
        {
            lv--;
            float lvf = (float) lv;
            //return lv;
            return (uint64_t) ((((0.5 * lvf * lvf * lvf) - (1.5 * lvf * lvf) + (4.0 * lvf)) / 3.0) / 10.0);
        }
to change mana and Hp for precent.

https://otland.net/threads/jak-wysylac-hp-i-mane-w-procentach.181560/

war.lua Talkaction script
Code:
function onSay(cid, words, param, channel)
    local guild = getPlayerGuildId(cid)
    if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then
        doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    local t = string.explode(param, ",")
    if(not t[2]) then
        doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    local enemy = getGuildId(t[2])
    if(not enemy) then
        doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    if(enemy == guild) then
        doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy)
    if(tmp:getID() ~= -1) then
        enemyName = tmp:getDataString("name")
        tmp:free()
    end
    if(isInArray({"accept", "reject", "cancel"}, t[1])) then
        local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild
        if(t[1] == "cancel") then
            query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy
        end
        tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0")
        if(tmp:getID() == -1) then
            doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
            return true
        end
        if(t[1] == "accept") then
            local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild)
            local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment")
            _tmp:free()
            if(state) then
                doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0)
                return true
            end
            db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild)
        end
        query = "UPDATE `guild_wars` SET "
        local msg = "accepted " .. enemyName .. " invitation to war."
        if(t[1] == "reject") then
            query = query .. "`end` = " .. os.time() .. ", `status` = 2"
            msg = "rejected " .. enemyName .. " invitation to war."
        elseif(t[1] == "cancel") then
            query = query .. "`end` = " .. os.time() .. ", `status` = 3"
            msg = "canceled invitation to a war with " .. enemyName .. "."
        else
            query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1"
        end
        query = query .. " WHERE `id` = " .. tmp:getDataInt("id")
        if(t[1] == "accept") then
            doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD)
            doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY)
        end
        tmp:free()
        db.executeQuery(query)
        doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE)
        return true
    end
    if(t[1] == "invite") then
        local str = ""
                tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)")
                if(tmp:getID() ~= -1) then
                        if(tmp:getDataInt("status") == 0) then
                                if(tmp:getDataInt("guild_id") == guild) then
                                        str = "You have already invited " .. enemyName .. " to war."
                                else
                                        str = enemyName .. " have already invited you to war."
                                end
            else
                str = "You are already on a war with " .. enemyName .. "."
            end
            tmp:free()
        end
        if(str ~= "") then
            doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0)
            return true
        end
        local frags = tonumber(t[3])
        if(frags ~= nil) then
            frags = math.max(10, math.min(1000, frags))
        else
            frags = 100
        end
        local payment = tonumber(t[4])
        if(payment ~= nil) then
            payment = math.max(100000, math.min(1000000000, payment))
            tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild)
            local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment
            tmp:free()
            if(state) then
                doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0)
                return true
            end
            db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild)
        else
            payment = 0
        end
        local begining, ending = os.time(), tonumber(t[5])
        if(ending ~= nil and ending ~= 0) then
            ending = begining + (ending * 86400)
        else
            ending = 0
        end
        db.executeQuery("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");")
        doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE)
        return true
    end
    if(not isInArray({"end", "finish"}, t[1])) then
        return false
    end
    local status = (t[1] == "end" and 1 or 4)
    tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status)
    if(tmp:getID() ~= -1) then
        local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id")
        tmp:free()
        doGuildRemoveEnemy(guild, enemy)
        doGuildRemoveEnemy(enemy, guild)
        db.executeQuery(query)
        doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
        return true
    end
    if(status == 4) then
        doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1")
    if(tmp:getID() ~= -1) then
        if(tmp:getDataInt("end") > 0) then
            tmp:free()
            doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
            return true
        end
        local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id")
        tmp:free()
        db.executeQuery(query)
        doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
        return true
    end
    doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
    return true
end
 
Last edited:

Joutarn

New Member
Joined
Jul 8, 2016
Messages
21
Best answers
0
Reaction score
1
but its only source i need clean data , s3db file
 

Joutarn

New Member
Joined
Jul 8, 2016
Messages
21
Best answers
0
Reaction score
1
war system work on sqlite or i need change it to mysql ?
 
OP
heba

heba

Veteran OT User
Joined
Aug 5, 2011
Messages
1,363
Best answers
13
Reaction score
171
mysql better
u must chnage to take more experiences
 

Joutarn

New Member
Joined
Jul 8, 2016
Messages
21
Best answers
0
Reaction score
1
there is a good thread to learn ?
 
OP
heba

heba

Veteran OT User
Joined
Aug 5, 2011
Messages
1,363
Best answers
13
Reaction score
171
use search and u will found alot
 

Joutarn

New Member
Joined
Jul 8, 2016
Messages
21
Best answers
0
Reaction score
1
i compiled but i have problem i have error [ Error while saving players ]
 
OP
heba

heba

Veteran OT User
Joined
Aug 5, 2011
Messages
1,363
Best answers
13
Reaction score
171
Code:
ALTER TABLE  `players` ADD  `cast` TINYINT NOT NULL DEFAULT  '0',
ADD  `castViewers` INT( 11 ) NOT NULL DEFAULT  '0',
ADD  `castDescription` VARCHAR( 255 ) NOT NULL
 

shass

Banned User
Joined
Dec 3, 2017
Messages
67
Best answers
0
Reaction score
6
This sourece for tibia 8.60 0.4 {Windows}

Download link
reall map source with full edite.rar

Edite
1: Player walk { dp tile 11063},

2:Nomoveitems {done},

3: Ghost spell {done},

4:war shield system {done}, Use war.lua i add down

5: cast system {done}, set this in confing.lua {enableCast = true}

6: Show player level and vocation in login {done},

7: conjure runes on your bag {done}

Edite maybe you will need it

Open level for 10 million

Player.h

change
static uint64_t getExpForLevel(uint32_t lv)
to
Code:
static uint64_t getExpForLevel(uint32_t lv)
        {
            lv--;
            float lvf = (float) lv;
            //return lv;
            return (uint64_t) ((((0.5 * lvf * lvf * lvf) - (1.5 * lvf * lvf) + (4.0 * lvf)) / 3.0) / 10.0);
        }
to change mana and Hp for precent.

Jak wysyłać HP i manę w procentach

war.lua Talkaction script
Code:
function onSay(cid, words, param, channel)
    local guild = getPlayerGuildId(cid)
    if(not guild or getPlayerGuildLevel(cid) < GUILDLEVEL_LEADER) then
        doPlayerSendChannelMessage(cid, "", "You cannot execute this talkaction.", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    local t = string.explode(param, ",")
    if(not t[2]) then
        doPlayerSendChannelMessage(cid, "", "Not enough param(s).", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    local enemy = getGuildId(t[2])
    if(not enemy) then
        doPlayerSendChannelMessage(cid, "", "Guild \"" .. t[2] .. "\" does not exists.", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    if(enemy == guild) then
        doPlayerSendChannelMessage(cid, "", "You cannot perform war action on your own guild.", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    local enemyName, tmp = "", db.getResult("SELECT `name` FROM `guilds` WHERE `id` = " .. enemy)
    if(tmp:getID() ~= -1) then
        enemyName = tmp:getDataString("name")
        tmp:free()
    end
    if(isInArray({"accept", "reject", "cancel"}, t[1])) then
        local query = "`guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild
        if(t[1] == "cancel") then
            query = "`guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy
        end
        tmp = db.getResult("SELECT `id`, `begin`, `end`, `payment` FROM `guild_wars` WHERE " .. query .. " AND `status` = 0")
        if(tmp:getID() == -1) then
            doPlayerSendChannelMessage(cid, "", "Currently there's no pending invitation for a war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
            return true
        end
        if(t[1] == "accept") then
            local _tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild)
            local state = _tmp:getID() < 0 or _tmp:getDataInt("balance") < tmp:getDataInt("payment")
            _tmp:free()
            if(state) then
                doPlayerSendChannelMessage(cid, "", "Your guild balance is too low to accept this invitation.", TALKTYPE_CHANNEL_W, 0)
                return true
            end
            db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. tmp:getDataInt("payment") .. " WHERE `id` = " .. guild)
        end
        query = "UPDATE `guild_wars` SET "
        local msg = "accepted " .. enemyName .. " invitation to war."
        if(t[1] == "reject") then
            query = query .. "`end` = " .. os.time() .. ", `status` = 2"
            msg = "rejected " .. enemyName .. " invitation to war."
        elseif(t[1] == "cancel") then
            query = query .. "`end` = " .. os.time() .. ", `status` = 3"
            msg = "canceled invitation to a war with " .. enemyName .. "."
        else
            query = query .. "`begin` = " .. os.time() .. ", `end` = " .. (tmp:getDataInt("end") > 0 and (os.time() + ((tmp:getDataInt("begin") - tmp:getDataInt("end")) / 86400)) or 0) .. ", `status` = 1"
        end
        query = query .. " WHERE `id` = " .. tmp:getDataInt("id")
        if(t[1] == "accept") then
            doGuildAddEnemy(guild, enemy, tmp:getDataInt("id"), WAR_GUILD)
            doGuildAddEnemy(enemy, guild, tmp:getDataInt("id"), WAR_ENEMY)
        end
        tmp:free()
        db.executeQuery(query)
        doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. msg, MESSAGE_EVENT_ADVANCE)
        return true
    end
    if(t[1] == "invite") then
        local str = ""
                tmp = db.getResult("SELECT `guild_id`, `status` FROM `guild_wars` WHERE `guild_id` IN (" .. guild .. "," .. enemy .. ") AND `enemy_id` IN (" .. enemy .. "," .. guild .. ") AND `status` IN (0, 1)")
                if(tmp:getID() ~= -1) then
                        if(tmp:getDataInt("status") == 0) then
                                if(tmp:getDataInt("guild_id") == guild) then
                                        str = "You have already invited " .. enemyName .. " to war."
                                else
                                        str = enemyName .. " have already invited you to war."
                                end
            else
                str = "You are already on a war with " .. enemyName .. "."
            end
            tmp:free()
        end
        if(str ~= "") then
            doPlayerSendChannelMessage(cid, "", str, TALKTYPE_CHANNEL_W, 0)
            return true
        end
        local frags = tonumber(t[3])
        if(frags ~= nil) then
            frags = math.max(10, math.min(1000, frags))
        else
            frags = 100
        end
        local payment = tonumber(t[4])
        if(payment ~= nil) then
            payment = math.max(100000, math.min(1000000000, payment))
            tmp = db.getResult("SELECT `balance` FROM `guilds` WHERE `id` = " .. guild)
            local state = tmp:getID() < 0 or tmp:getDataInt("balance") < payment
            tmp:free()
            if(state) then
                doPlayerSendChannelMessage(cid, "", "Your guild balance is too low for such payment.", TALKTYPE_CHANNEL_W, 0)
                return true
            end
            db.executeQuery("UPDATE `guilds` SET `balance` = `balance` - " .. payment .. " WHERE `id` = " .. guild)
        else
            payment = 0
        end
        local begining, ending = os.time(), tonumber(t[5])
        if(ending ~= nil and ending ~= 0) then
            ending = begining + (ending * 86400)
        else
            ending = 0
        end
        db.executeQuery("INSERT INTO `guild_wars` (`guild_id`, `enemy_id`, `begin`, `end`, `frags`, `payment`) VALUES (" .. guild .. ", " .. enemy .. ", " .. begining .. ", " .. ending .. ", " .. frags .. ", " .. payment .. ");")
        doBroadcastMessage(getPlayerGuildName(cid) .. " has invited " .. enemyName .. " to war till " .. frags .. " frags.", MESSAGE_EVENT_ADVANCE)
        return true
    end
    if(not isInArray({"end", "finish"}, t[1])) then
        return false
    end
    local status = (t[1] == "end" and 1 or 4)
    tmp = db.getResult("SELECT `id` FROM `guild_wars` WHERE `guild_id` = " .. guild .. " AND `enemy_id` = " .. enemy .. " AND `status` = " .. status)
    if(tmp:getID() ~= -1) then
        local query = "UPDATE `guild_wars` SET `end` = " .. os.time() .. ", `status` = 5 WHERE `id` = " .. tmp:getDataInt("id")
        tmp:free()
        doGuildRemoveEnemy(guild, enemy)
        doGuildRemoveEnemy(enemy, guild)
        db.executeQuery(query)
        doBroadcastMessage(getPlayerGuildName(cid) .. " has " .. (status == 4 and "mend fences" or "ended up a war") .. " with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
        return true
    end
    if(status == 4) then
        doPlayerSendChannelMessage(cid, "", "Currently there's no pending war truce from " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
        return true
    end
    tmp = db.getResult("SELECT `id`, `end` FROM `guild_wars` WHERE `guild_id` = " .. enemy .. " AND `enemy_id` = " .. guild .. " AND `status` = 1")
    if(tmp:getID() ~= -1) then
        if(tmp:getDataInt("end") > 0) then
            tmp:free()
            doPlayerSendChannelMessage(cid, "", "You cannot request ending for war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
            return true
        end
        local query = "UPDATE `guild_wars` SET `status` = 4, `end` = " .. os.time() .. " WHERE `id` = " .. tmp:getDataInt("id")
        tmp:free()
        db.executeQuery(query)
        doBroadcastMessage(getPlayerGuildName(cid) .. " has signed an armstice declaration on a war with " .. enemyName .. ".", MESSAGE_EVENT_ADVANCE)
        return true
    end
    doPlayerSendChannelMessage(cid, "", "Currently there's no active war with " .. enemyName .. ".", TALKTYPE_CHANNEL_W, 0)
    return true
end

what's ghost spells?
 
OP
heba

heba

Veteran OT User
Joined
Aug 5, 2011
Messages
1,363
Best answers
13
Reaction score
171
what's ghost spells?
Code:
--//## made bye Heba ##//--
function doSendEffectes(cid)
doSendAnimatedText(getPlayerPosition(cid), "I'm here!", COLOR_YELLOW)
local position = getCreaturePosition(cid)
            doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
            for i = 1, 30 do
doSendDistanceShoot({x = position.x + math.random(-4 ,4), y = position.y + math.random(-4 ,4), z = position.z}, position, 32)
end
end

function doBlockEffect(cid)
doSendMagicEffect(getCreaturePosition(cid), 9)
     return
end

local condition = createConditionObject(CONDITION_INFIGHT)
setConditionParam(condition, CONDITION_PARAM_TICKS, 6 * 1000)

function onUse(cid, item, frompos, item2, topos)
if (exhaustion.check(cid, 1725)) then
        doPlayerSendCancel(cid, "You will be able to use this GEM again in  "..tostring(exhaustion.get(cid, 1725)).." seconds.")
        return true
    end
    if not(getPlayerSlotItem(cid, 10).itemid == 12637) then
        doPlayerSendCancel(cid, "Put this items in arrows spot")
        return true
    end
if (getPlayerSlotItem(cid, 10).itemid == 12637) then
doCreatureExecuteTalkAction(cid, "/ghost", true)
addEvent(showPlayer, 5000, cid)
addEvent(doSendEffectes, 5000, cid)
doAddCondition(cid, condition)
exhaustion.set(cid, 1725, 180)
     for x = 1, 5 do
         addEvent(doBlockEffect, x * 1000, cid)
     end
doSendAnimatedText(getCreaturePosition(cid), "Invis!", COLOR_GREY)
local position = getCreaturePosition(cid)
for i = 1, 30 do
doSendDistanceShoot(position, {x = position.x + math.random(-4, 4), y = position.y + math.random(-4, 4), z = position.z}, 32)
end
return true
end
end
use this gem action not spell
this gem will take the player in ghost mod for 5 sec its made by me
 
OP
heba

heba

Veteran OT User
Joined
Aug 5, 2011
Messages
1,363
Best answers
13
Reaction score
171
and add this in lib/050-function
Code:
function showPlayer(cid)
    doCreatureExecuteTalkAction(cid, "/ghost", true)
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) 
    return true
end
 

5lave Ots

Member
Joined
Oct 2, 2017
Messages
147
Best answers
0
Reaction score
5
the application was unable too start correctly 0xc000007b click ok to close the app
do you know what is this?, im using windows 10, 64bit for 860 server
 

chekybrekyv

Banned User
Joined
Oct 15, 2018
Messages
113
Best answers
0
Reaction score
60
the application was unable too start correctly 0xc000007b click ok to close the app
do you know what is this?, im using windows 10, 64bit for 860 server
need to install redistributables for x86 and x64
 
Top