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

House Info'

MrLipzZz

HTML 'haha
Joined
Nov 27, 2008
Messages
171
Reaction score
0
Location
Brazil
is possible to do a Script called HouseInfo, is an talk action,
is something Like that !

player says !houseinfo

and get this..

Hi, MrHouseOwner :p

Buy Date : X
Rent Value : Normal House Price ( housePriceAsRent )
Next Payment : (Day in the week cous is Weekly !! )

So, possible? if yes, ill post on the Request area !

tks d00d !
 
Lua:
    getHouseInfo(id)
    getHouseAccessList(houseid, listid)
    getHouseByPlayerGUID(playerGUID)
    getHouseName(houseId)
    getHouseEntry(houseId)
    getHouseRent(houseId)
    getHousePrice(houseId)
    getHouseTown(houseId)
    getHouseTilesCount(houseId)

Code:
int32_t LuaScriptInterface::luaGetHouseInfo(lua_State* L)
{
    //getHouseInfo(houseId)
    bool displayError = true;
    if(lua_gettop(L) > 1)
        displayError = popNumber(L);

    House* house = Houses::getInstance()->getHouse(popNumber(L));
    if(!house)
    {
        if(displayError)
            errorEx(getError(LUA_ERROR_HOUSE_NOT_FOUND));

        lua_pushboolean(L, false);
        return 1;
    }

    lua_newtable(L);
    setField(L, "id", house->getId());
    setField(L, "name", house->getName().c_str());
    setField(L, "owner", house->getOwner());

    lua_pushstring(L, "entry");
    pushPosition(L, house->getEntry(), 0);
    pushTable(L);

    setField(L, "rent", house->getRent());
    setField(L, "price", house->getPrice());
    setField(L, "town", house->getTownId());
    setField(L, "paidUntil", house->getPaidUntil());
    setField(L, "warnings", house->getRentWarnings());
    setField(L, "lastWarning", house->getLastWarning());

    setFieldBool(L, "guildHall", house->isGuild());
    setField(L, "size", house->getSize());
    setField(L, "doors", house->getDoorsCount());
    setField(L, "beds", house->getBedsCount());
    setField(L, "tiles", house->getTilesCount());

    return 1;
}
let's see what we can do :p
 
those are the functions we need in order to create the script
i'm not sure about buy date, didn't find it ;x
This is the one i made(ignore the zeros):
23:37 Hi, Zero. You own the house named "Unnamed House #147"
Location: Ciudad Capital
Rent value: 0
Next Payment: 0


data/talkactions/
talkactions.xml
Lua:
<talkaction words="!house" event="script" value="houseinfo.lua"/>

data/talkactions/scripts/houseinfo.lua
Lua:
function onSay(cid, words, param, channel)
    if getHouseByPlayerGUID(getPlayerGUID(cid)) == nil then
        doPlayerSendCancel(cid, 'You do not own a house.')
    return true
    end
    
    local house = getHouseByPlayerGUID(getPlayerGUID(cid))

    str1 = 'Hi, '.. getCreatureName(cid) ..'. You own the house named "'.. getHouseName(house) ..'"'
    str2 = 'Location: '.. getTownName(getHouseInfo(house).town) 
    str3 = 'Rent value: '.. getHouseRent(house) 
    str4 = 'Next Payment: '.. os.date("%d %B %Y %X ", getHouseInfo(house).paidUntil)
    doPlayerSendTextMessage(cid, 20, str1 ..'\n'.. str2 ..'\n'.. str3 ..'\n'.. str4)
    
return true
end
 
Last edited:
Ill try it ! edit in minutes!

-edit-

So, here we go!

00:43 Hi, GOD Lipz. You own the house named "LostWorld 48"
Location: Blood City
Rent value: 1662500
Next Payment: 0

No erros in Console!

- I need put ur first code in some place?
 
post your config.lua, i wanna see smth
(dont post the passwords or db info :p )
house rent is price or time? i don't know that much of some tibiarl features
 
-- The Forgotten Server Config

-- Account manager
accountManager = false
namelockManager = true
newPlayerChooseVoc = true
newPlayerSpawnPosX = 160
newPlayerSpawnPosY = 51
newPlayerSpawnPosZ = 7
newPlayerTownId = 1
newPlayerLevel = 8
newPlayerMagicLevel = 1
generateAccountNumber = false

-- Unjustified kills
redSkullLength = 30 * 24 * 60 * 60
blackSkullLength = 45 * 24 * 60 * 60
dailyFragsToRedSkull = 3
weeklyFragsToRedSkull = 5
monthlyFragsToRedSkull = 10
dailyFragsToBlackSkull = dailyFragsToRedSkull
weeklyFragsToBlackSkull = weeklyFragsToRedSkull
monthlyFragsToBlackSkull = monthlyFragsToRedSkull
dailyFragsToBanishment = dailyFragsToRedSkull
weeklyFragsToBanishment = weeklyFragsToRedSkull
monthlyFragsToBanishment = monthlyFragsToRedSkull
blackSkulledDeathHealth = 40
blackSkulledDeathMana = 0
useBlackSkull = true
useFragHandler = true
advancedFragList = false

-- Banishments
-- killsBanLength works only if useBlackSkull option is disabled.
notationsToBan = 3
warningsToFinalBan = 4
warningsToDeletion = 5
banLength = 7 * 24 * 60 * 60
killsBanLength = 7 * 24 * 60 * 60
finalBanLength = 30 * 24 * 60 * 60
ipBanishmentLength = 1 * 24 * 60 * 60
broadcastBanishments = true
maxViolationCommentSize = 200
violationNameReportActionType = 2
autoBanishUnknownBytes = false

-- Battle
-- loginProtectionPeriod is the famous Tibia anti-magebomb system.
-- deathLostPercent set to nil enables manual mode.
worldType = "pvp"
protectionLevel = 50
pvpTileIgnoreLevelAndVocationProtection = true
pzLocked = 60 * 1000
huntingDuration = 60 * 1000
criticalHitChance = 7
criticalHitMultiplier = 1
displayCriticalHitNotify = false
removeWeaponAmmunition = false
removeWeaponCharges = false
removeRuneCharges = true
whiteSkullTime = 15 * 60 * 1000
noDamageToSameLookfeet = false
showHealingDamage = false
showHealingDamageForMonsters = false
fieldOwnershipDuration = 5 * 1000
stopAttackingAtExit = false
oldConditionAccuracy = false
loginProtectionPeriod = 10 * 1000
deathLostPercent = 10
stairhopDelay = 2 * 1000
pushCreatureDelay = 2 * 1000
deathContainerId = 1987
gainExperienceColor = 215
addManaSpentInPvPZone = true
squareColor = 0
allowFightback = true

-- Connection config
worldId = 0
ip = "lwot.servegame.com"
bindOnlyConfiguredIpAddress = false
loginPort = 7171
gamePort = 7172
adminPort = 7171
statusPort = 7171
loginTries = 10
retryTimeout = 5 * 1000
loginTimeout = 60 * 1000
maxPlayers = 40
motd = "Bem Vindo ao LostWorld OT"
displayOnOrOffAtCharlist = false
onePlayerOnlinePerAccount = true
allowClones = false
serverName = "LostWorldOT"
loginMessage = "Bem Vindo ao LostWorld OT"
statusTimeout = 5 * 60 * 1000
replaceKickOnLogin = true
forceSlowConnectionsToDisconnect = false
loginOnlyWithLoginServer = false
premiumPlayerSkipWaitList = false

-- Database
-- To disable sqlKeepAlive such as mysqlReadTimeout use 0 value.
sqlType = "***"
sqlHost = "***"
sqlPort = "***"
sqlUser = "***"
sqlPass = "***"
sqlDatabase = "***"
sqlFile = "forgottenserver.s3db"
sqlKeepAlive = 0
mysqlReadTimeout = 10
mysqlWriteTimeout = 10
encryptionType = "SHA1"

-- Deathlist
deathListEnabled = true
deathListRequiredTime = 1 * 60 * 1000
deathAssistCount = 19
maxDeathRecords = 5

-- Guilds
ingameGuildManagement = false
levelToFormGuild = 8
premiumDaysToFormGuild = 0
guildNameMinLength = 4
guildNameMaxLength = 20

-- Highscores
highscoreDisplayPlayers = 15
updateHighscoresAfterMinutes = 60

-- Houses
buyableAndSellableHouses = true
houseNeedPremium = true
bedsRequirePremium = true
levelToBuyHouse = 100
housesPerAccount = 1
houseRentAsPrice = false
housePriceAsRent = true
housePriceEachSquare = 1750
houseRentPeriod = "weekly"
houseCleanOld = 0
guildHalls = false

-- Item usage
timeBetweenActions = 200
timeBetweenExActions = 1000
checkCorpseOwner = true
hotkeyAimbotEnabled = true
maximumDoorLevel = 500

-- Map
-- useHouseDataStorage usage may be found at README.
mapName = "Styller"
mapAuthor = "Lipz"
randomizeTiles = true
useHouseDataStorage = false
storeTrash = true
cleanProtectedZones = true
mailboxDisabledTowns = "-1"

-- Startup
defaultPriority = "high"
niceLevel = 5
coresUsed = "-1"
optimizeDatabaseAtStartup = true
removePremiumOnInit = true
confirmOutdatedVersion = false

-- Muted buffer
maxMessageBuffer = 4
bufferMutedOnSpellFailure = false

-- Miscellaneous
dataDirectory = "data/"
allowChangeOutfit = true
allowChangeColors = true
allowChangeAddons = true
disableOutfitsForPrivilegedPlayers = false
bankSystem = true
saveGlobalStorage = true
displaySkillLevelOnAdvance = false
spellNameInsteadOfWords = false
emoteSpells = false
promptExceptionTracerErrorBox = true
storePlayerDirection = false
monsterLootMessage = 3
monsterLootMessageType = 25
separateViplistPerCharacter = false

-- Ghost mode
ghostModeInvisibleEffect = false
ghostModeSpellEffects = true

-- Limits
idleWarningTime = 14 * 60 * 1000
idleKickTime = 15 * 60 * 1000
expireReportsAfterReads = 1
playerQueryDeepness = 2
maxItemsPerPZTile = 0
maxItemsPerHouseTile = 0

-- Premium-related
freePremium = false
premiumForPromotion = true

-- Blessings
blessingOnlyPremium = true
blessingReductionBase = 30
blessingReductionDecreament = 5
eachBlessReduction = 8

-- Rates
-- rateExperienceFromPlayers 0 to disable.
experienceStages = false
rateExperience = 30.0
rateExperienceFromPlayers = 0
rateSkill = 40.0
rateMagic = 20.0
rateLoot = 1.0
rateSpawn = 1

-- Monster rates
rateMonsterHealth = 1.0
rateMonsterMana = 1.0
rateMonsterAttack = 1.0
rateMonsterDefense = 1.0

-- Experience from players
minLevelThresholdForKilledPlayer = 0.9
maxLevelThresholdForKilledPlayer = 1.1

-- Stamina
rateStaminaLoss = 1
rateStaminaGain = 3
rateStaminaThresholdGain = 12
staminaRatingLimitTop = 41 * 60
staminaRatingLimitBottom = 14 * 60
rateStaminaAboveNormal = 1.5
rateStaminaUnderNormal = 0.5
staminaThresholdOnlyPremium = true

-- Party
experienceShareRadiusX = 30
experienceShareRadiusY = 30
experienceShareRadiusZ = 1
experienceShareLevelDifference = 2 / 3
extraPartyExperienceLimit = 20
extraPartyExperiencePercent = 5
experienceShareActivity = 2 * 60 * 1000

-- Global save
globalSaveEnabled = false
globalSaveHour = 8
shutdownAtGlobalSave = true
cleanMapAtGlobalSave = false

-- Spawns
deSpawnRange = 2
deSpawnRadius = 50

-- Summons
maxPlayerSummons = 2
teleportAllSummons = false
teleportPlayerSummons = false

-- Status
ownerName = "Lipz"
ownerEmail = "[email protected]"
url = ""
location = "Brazil"
displayGamemastersWithOnlineCommand = false

-- Logs
adminLogsEnabled = false
displayPlayersLogging = true
prefixChannelLogs = ""
runFile = ""
outLogName = ""
errorLogName = ""
truncateLogsOnStartup = false

hehe :) !
In Database, i can see a thing in houses "Last Warning" , but idk for WHAT! haha :)
 
can't do more ;x
Lua:
function onSay(cid, words, param, channel)
    if getHouseByPlayerGUID(getPlayerGUID(cid)) == nil then
        doPlayerSendCancel(cid, 'You do not own a house.')
    return true
    end
    
    local house = getHouseByPlayerGUID(getPlayerGUID(cid))
    local h = getHouseInfo(house)

    str1 = 'Hi, '.. getCreatureName(cid) ..'. You own the house named "'.. getHouseName(house) ..'"'
    str2 = 'Location: '.. getTownName(h.town) 
    str3 = 'Rent value: '.. getHouseRent(house) 
    str4 = h.warnings ~= 0 and 'Warnings: '.. h.warnings or ''
    str5 = h.lastWarning ~= 0 and 'Last Warning: '.. os.date("%d %B %Y %X ", h.lastWarning) or ''
    str6 = 'Next Payment: '.. os.date("%d %B %Y %X ", h.paidUntil)
    doPlayerSendTextMessage(cid, 20, str1 ..'\n'.. str2 ..'\n'.. str3 ..'\n'.. str4.. '\n'.. str5 ..'\n'.. str6)
    
return true
end
 
Last edited:
01:14 Hi, GOD Lipz. You own the house named "LostWorld 48"
Location: Blood City
Rent value: 1662500
Warnings: 2
Last Warning: 29 June 2010 01:36:27
Next Payment: 31 December 1969 22:00:00


No erros on console haha
LastWarning idk if this is right..anyway
i think next payment doesnt work properly o.o !
 
No no no
im bought this house, hmmmm
few days ago, maybe 2..3 !

- and wtf.

How do i pay again?
Have an expecific command to update the rent ? buy again?
 
idk how to proceed this request..
Mock has recused help hahahahhahahaha idk why xD
and u..u already helped, and still not working :(
 
Back
Top