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

TheImaginedServer & TheImaginedClient (custom TFS and Client) - Updated 1/16/2015

I would have a suggestion!

Recode everything to let the scripters define conditions at the same time a script get's executed!
like
Code:
local val = {}

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, val[1])
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, val[2])
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, val[3])

function blabla(cid)
    for i = 1, XXX do
    table.insert(val, i)
end
doAddCondition(cid, condition)
end

Is that possible for future releases?
 
I would have a suggestion!

Recode everything to let the scripters define conditions at the same time a script get's executed!
like
Code:
local val = {}

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 1)
setConditionParam(condition, CONDITION_PARAM_BUFF_SPELL, 1)
setConditionParam(condition, CONDITION_PARAM_TICKS, 5 * 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, val[1])
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, val[2])
setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, val[3])

function blabla(cid)
    for i = 1, XXX do
    table.insert(val, i)
end
doAddCondition(cid, condition)
end

Is that possible for future releases?

Actually, I completely agree with this.
The way Conditions are handled in TFS is very limiting and makes it hard to make fun and interesting things happen with them.

I'm adding this to the list!
 
Uhm... I'll have another request (or maybe you can help me even further)

NPCs can be attackable if you add
PHP:
attackable="1"
at the NPC file (where it's name is declared and look and stuff)

BUT he doesn't take any DMG at all, because of this:
Code:
bool isImmune(CombatType_t) const {
return true;
}
bool isImmune(ConditionType_t) const {
return true;
}
virtual bool isAttackable() const {
return attackable;

Would it be difficult to code the "isImmune" thing like the "isAttackable" function?
So scripters could either choose to make NPC invulnerable or killable.

Wow, that would be awesome! You could have REAL NPC matches!!
REAL NPC Guards!
REAL NPC which can be killed if you don't like the answer!

Endless possibileties!
 
Uhm... I'll have another request (or maybe you can help me even further)

NPCs can be attackable if you add
PHP:
attackable="1"
at the NPC file (where it's name is declared and look and stuff)

BUT he doesn't take any DMG at all, because of this:
Code:
bool isImmune(CombatType_t) const {
return true;
}
bool isImmune(ConditionType_t) const {
return true;
}
virtual bool isAttackable() const {
return attackable;

Would it be difficult to code the "isImmune" thing like the "isAttackable" function?
So scripters could either choose to make NPC invulnerable or killable.

Wow, that would be awesome! You could have REAL NPC matches!!
REAL NPC Guards!
REAL NPC which can be killed if you don't like the answer!

Endless possibileties!

Sure, but the NPC should use mana pots, healing spells and shit. Also attack you back if you attack the NPC.
Would be cool :)
 
NPCs being attackable and killable is already being worked on.
They will even respawn at the temple where players do, and then go back to where they belong.
 
You can script that into the npc.lua file, not a big deal
if health < 100 add health, sendmagiceffect
randomvalue = 5, send magiceffect(exori) player:addHealth(target, -200)
and so on and so forth.

@Flatlander could you make it optional to let them respawn at the temple or respawn like a monster?
That would make it even more versatile!
 
Of course, all of the features will be optional.

We want to make it so NPCs are more life-like, so they have all the stats of a creature, but you can talk and interract with them.

On my upcoming server, they will go to sleep at night, wake up and walk to work, do tasks, etc.
 
hi @Flatlander , I'd have another request.
Could you readd (either hardcoded or at global.lua) the function "exhaustion.set/get" ?
I dunno why but it seems the devs removed it from the 1.0 branch, I can't seem to find it.

here's the code:
Code:
exhaustion =
{
   check = function (cid, storage)
     if(getPlayerFlagValue(cid, PlayerFlag_HasNoExhaustion)) then
       return false
     end

     return getPlayerStorageValue(cid, storage) >= os.time(t)
   end,

   get = function (cid, storage)
     if(getPlayerFlagValue(cid, PlayerFlag_HasNoExhaustion)) then
       return false
     end

     local exhaust = getPlayerStorageValue(cid, storage)
     if(exhaust > 0) then
       local left = exhaust - os.time(t)
       if(left >= 0) then
         return left
       end
     end

     return false
   end,

   set = function (cid, storage, time)
     setPlayerStorageValue(cid, storage, os.time(t) + time)
   end,

   make = function (cid, storage, time)
     local exhaust = exhaustion.get(cid, storage)
     if(not exhaust) then
       exhaustion.set(cid, storage, time)
       return true
     end

     return false
   end
}
 
hi @Flatlander , I'd have another request.
Could you readd (either hardcoded or at global.lua) the function "exhaustion.set/get" ?
I dunno why but it seems the devs removed it from the 1.0 branch, I can't seem to find it.

here's the code:
Code:
exhaustion =
{
   check = function (cid, storage)
     if(getPlayerFlagValue(cid, PlayerFlag_HasNoExhaustion)) then
       return false
     end

     return getPlayerStorageValue(cid, storage) >= os.time(t)
   end,

   get = function (cid, storage)
     if(getPlayerFlagValue(cid, PlayerFlag_HasNoExhaustion)) then
       return false
     end

     local exhaust = getPlayerStorageValue(cid, storage)
     if(exhaust > 0) then
       local left = exhaust - os.time(t)
       if(left >= 0) then
         return left
       end
     end

     return false
   end,

   set = function (cid, storage, time)
     setPlayerStorageValue(cid, storage, os.time(t) + time)
   end,

   make = function (cid, storage, time)
     local exhaust = exhaustion.get(cid, storage)
     if(not exhaust) then
       exhaustion.set(cid, storage, time)
       return true
     end

     return false
   end
}

You can make these in LUA.
Just pick a storage for exhaustion then -
Literally just change exhaustion.set to setPlayerStorageValue(cid, storage, os.time(t) + time)
and change exhaustion.get to getPlayerStorageValue(cid, storage)
 
You can make these in LUA.
Just pick a storage for exhaustion then -
Literally just change exhaustion.set to setPlayerStorageValue(cid, storage, os.time(t) + time)
and change exhaustion.get to getPlayerStorageValue(cid, storage)

Absolutely right, but I'm such a lazy scripter that I want it as easy as possible xD
I'm using those functions already, can't hurt to have them in every global.lua file? :D

I could copy/paste them myself into the github global though.... but I'd need to install the github things and stuff and.... .... .... I'm so lazy xD
 
I am not part of the team that is working on the GITHUB version of TFS :p. My version is specifically being made to work with the OTClient.

TFS 1.0 already works amazing for any RL Map, if you are making a custom server, you should be using OTClient.
 
Remove This line in spawns.cpp
Code:
findPlayer(sb.pos)
to make it better so monsters can spawn even if there is player blocking the spawn.or you can change this
Code:
bool Spawn::findPlayer(const Position& pos)
{
SpectatorVec list;
g_game.getSpectators(list, pos);

Player* tmpPlayer = NULL;
for(SpectatorVec::iterator it = list.begin(); it != list.end(); ++it)
{
if((tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->hasFlag(PlayerFlag_IgnoredByMonsters))
return true;
}

return false;
}
TO
Code:
bool Spawn::findPlayer(const Position& pos)
{
SpectatorVec list;
g_game.getSpectators(list, pos);

Player* tmpPlayer = NULL;
for(SpectatorVec::iterator it = list.begin(); it != list.end(); ++it)
{
if((!g_config.getBool(ConfigManager::PLAYER_BLOCK_SPAWN) && tmpPlayer = (*it)->getPlayer()) && !tmpPlayer->hasFlag(PlayerFlag_IgnoredByMonsters))
return true;
}

return false;
}
And ofcourse edit the configmanager.cpp and the .h to add the bool
It it just my idea if you want to add it then ok :)
 
Back
Top Bottom