• 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

OK, my idea to fix this would be to be able to give each player his own world light.

For example.
Code:
setPlayerWorldLight(cid, lightlevel)


So you could set different world light for each player.
Examples: Sportacus wanted differen't light per level, just set a creaturescript (onWalk) that when you switch levels it changes your players worldlight.

Another Example: Quest where the world turns dark because of a storm, or the sun is eclipsed, etc.
 
Could you explain what you mean by local light?
I am refering to post of mine:
http://otland.net/threads/customizing-tfs-anything-you-want-me-to-add.200170/#post-1926688

OK, my idea to fix this would be to be able to give each player his own world light.

For example.
Code:
setPlayerWorldLight(cid, lightlevel)


So you could set different world light for each player.
Examples: Sportacus wanted differen't light per level, just set a creaturescript (onWalk) that when you switch levels it changes your players worldlight.

Another Example: Quest where the world turns dark because of a storm, or the sun is eclipsed, etc.
Okay, I could work with that. Not easiest way for create weird locations with recolorised sunlight/moonlight, but workable.
 
I wish TFS had a a config in config.lua to pick what server version you wanted to use. like 8.6 or 9.81 or 10.10, have it from like 8.6 and up :p
 
I wish TFS had a a config in config.lua to pick what server version you wanted to use. like 8.6 or 9.81 or 10.10, have it from like 8.6 and up :p

I might look into doing this. It would be a TON of work (since 8.6 is so different than 10.10). But I like the idea of being able to easily switch the client version able to log in.
 
Give us onAttack() plz, that would be so very much awesome yez!
If you make this could you add in a way to return the damage dealt, so you'd have something like:
Lua:
function onAttack(cid,target,damage,damagetype) --something like this dunno the exact parameters required
if damage > (getCreatureMaxHealth(cid) *0.2) then --something simple like if the damage is bigger then 20% of the targets max life, the damage is reduced by 50%.
     damage = damage /2
end
return damage
end
You can sort of do this with onStatsChange(), but in the client it will still display the original damage dealt not whatever you changed it to. Also you cannot return the new damage, you'd have to reduce the damage by healing the reduced amount back.
 
In quests.xml should be able to do quest log in more then 1 language. You can do e.g:

<quest name="name" language="storage_language_constant" languagevalue"eng" startstorageid="str" startstoragevalue="1">
 
Why you don't put it in a mercurial or git repo? You can get helpers in this huge task...
One thing i would add myself is shared lua States, its really improve tfs.
One perfect feature would be adding events from lua instead of xml, i don't know why i would like to add events in xml istead of calling a function from lua. It really improve the construction of monolitic systems.

Yamaken~
 
If you make this could you add in a way to return the damage dealt, so you'd have something like:
Lua:
function onAttack(cid,target,damage,damagetype) --something like this dunno the exact parameters required
if damage > (getCreatureMaxHealth(cid) *0.2) then --something simple like if the damage is bigger then 20% of the targets max life, the damage is reduced by 50%.
     damage = damage /2
end
return damage
end
You can sort of do this with onStatsChange(), but in the client it will still display the original damage dealt not whatever you changed it to. Also you cannot return the new damage, you'd have to reduce the damage by healing the reduced amount back.

Actually you could just return false with onStatsChange and it would not do the original damage, only the new damage. (This is how I managed all damages in some of my custom servers, so I could do whatever I want with them)

And I guess the reason I don't put it on mercurial or git repo is I want it done the correct way, and I don't really trust anyone else to do things correctly.

Everything you edit should be able to be turned "on and off in the config.lua" so that you can choose whether you want a feature or not. Plus I want to do it all myself because as I do things, I continue learning about how TFS works and it gives me new ideas of new features.
 
New update though.
World Light is now configurable in the config.lua.
Code:
   longday = 300 -- How long is a Day (in seconds)
   daypercent = 50 -- What percent of a day is light (day/night percent)
   nightlight = 1 -- How bright is it at night
   daylight = 250 -- How bright is it during the day
   lightcolor = 190 -- What color is the sun light (world light)

Some issues I came up with:
The client actually gets in the way of a lot of features. Examples:
  1. Once the client receives a "World Light" color you cannot change it. This means when a player logs in, and it sets his WorldLightColor, that will be the color of the world-light until he relogs again.
  2. Light Change Speed. ANOTHER problem! The client actually slowly changes the light itself. meaning if it is pitch black (Lightlevel = 0) and you set it to Bright (lightlevel = 250) it would take the client about 2 minutes to go from dark to bright. BUT if you relog, it will instantly be bright. (TO make sure all players have the same brightness, I set it to change a maximum of 15 units of light every 10 seconds)
So in conclusion, you cannot change WorldLightColor in-game. and you cannot make it go brighter than 15 units every 10 seconds. (Unless you use a custom client, which I'm not making this version of TFS for custom clients yet so who cares)

Next I will start working on Monster AI and Features :). SO expect updates on that!
 
Actually you could just return false with onStatsChange and it would not do the original damage, only the new damage. (This is how I managed all damages in some of my custom servers, so I could do whatever I want with them)

And I guess the reason I don't put it on mercurial or git repo is I want it done the correct way, and I don't really trust anyone else to do things correctly.

Everything you edit should be able to be turned "on and off in the config.lua" so that you can choose whether you want a feature or not. Plus I want to do it all myself because as I do things, I continue learning about how TFS works and it gives me new ideas of new features.
Yes ofc you can return false, but if you don't want to return all of the damage for example monster deals 50 damage and you reduce it with 20 then you'd have to return false, disable the creatureevent checking for this, reapply 30 damage, enable the creatureevent. And in the latest tfs version I used 0.3.6 (no prem so no 0.4) you couldn't disable/enable creatureevents through lua.
Also even if you can enable disable it's way more of a hassle then just returing the new correct damage value, ofc if it's like a week of work to just change this I can understand that you won't do it, but if it's like an hour or so it wouldn't be too much to ask right :)?
 
If it is a feature that will add something to TFS that was not before possible, or wasn't easy to do, I will add it.
But, I feel it is already easy to edit damages.
Example being:
Code:
function onStatsChange(cid, attacker, type, combat, value)
   -- type is for damage or healing
   -- combat is the type of damage
   -- value is the amount of damage
   
   -- with these 3 things you should be able to make any kind of damage you want.
   -- If you wanted to get complex, you can make new combat types in constant.lua for DAMAGE_LIFESTEAL, DAMAGE_CAKE, or anything imagionable
   if combat == DAMAGE_LIFESTEAL then
     doCreatureAddHealth(attacker, value)
   end
   
   -- If you wanted a reflect spell, or even a shield that blocks the next attack you could just create storage values that are added to the player
   if getPlayerStorageValue(cid, "shield") > 0 then
     doPlayerSetStorageValue(cid, "shield" 0)
     return false
   end
   return true
end

If there is anything you think you could not do with onStatsChange let me know, and I will find a way to make it possible.
 
If it is a feature that will add something to TFS that was not before possible, or wasn't easy to do, I will add it.
But, I feel it is already easy to edit damages.
Example being:
Code:
function onStatsChange(cid, attacker, type, combat, value)
   -- type is for damage or healing
   -- combat is the type of damage
   -- value is the amount of damage
  
   -- with these 3 things you should be able to make any kind of damage you want.
   -- If you wanted to get complex, you can make new combat types in constant.lua for DAMAGE_LIFESTEAL, DAMAGE_CAKE, or anything imagionable
   if combat == DAMAGE_LIFESTEAL then
     doCreatureAddHealth(attacker, value)
   end
  
   -- If you wanted a reflect spell, or even a shield that blocks the next attack you could just create storage values that are added to the player
   if getPlayerStorageValue(cid, "shield") > 0 then
     doPlayerSetStorageValue(cid, "shield" 0)
     return false
   end
   return true
end

If there is anything you think you could not do with onStatsChange let me know, and I will find a way to make it possible.
Fair enough, anything I can think of should be possible with onStatsChange, if I can think of something I wouldn't know how to do with it I will be back ;)
 
Now I am working on Monster AI, Aggro, Spells, and other features.

If there are any specific things you want to be able to do with monsters. Let me know and I will try to make it possible.
 
Add aggro, to monsters.
Player will gain more aggro if using any type of heal*, or damage**.

Try to create a monster that can pull player attacks into them to make them appear like they are tanking for their Shooters.
Make monsters ignore players with much higher level+, but if there's many monsters make them attack the player ++
Make monsters heal each others.
Make some creature circle the player before attempting attack, unless Range (Player)$
Make monster call for help




*Heals will generate more aggro, there fore healers will be most likely High priority.
** Instead of making a Tank/Knight generate more damage create spells that will pull all the aggro into them something like Exeta res.
+ Unless player attack them or they get to near like 1 SQM or so.
++ If Creature near other Creatures make them attack player 2-3 SQM apart from each other.
$ Perhaps on some cases it could work :p

Some ideas, I'm not sure if useful
 
Add aggro, to monsters.
Player will gain more aggro if using any type of heal*, or damage**.

Try to create a monster that can pull player attacks into them to make them appear like they are tanking for their Shooters.
Make monsters ignore players with much higher level+, but if there's many monsters make them attack the player ++
Make monsters heal each others.
Make some creature circle the player before attempting attack, unless Range (Player)$
Make monster call for help




*Heals will generate more aggro, there fore healers will be most likely High priority.
** Instead of making a Tank/Knight generate more damage create spells that will pull all the aggro into them something like Exeta res.
+ Unless player attack them or they get to near like 1 SQM or so.
++ If Creature near other Creatures make them attack player 2-3 SQM apart from each other.
$ Perhaps on some cases it could work :p

Some ideas, I'm not sure if useful

So creatures that can "taunt"... good idea. (Creature's cannot actually taunt, but you could make them absorb damage for their surrounding allies)
Monsters that ignore too high (or too low) of levels is a good idea. MonsterAggroMin = 10 MonsterAggroMax = 50

My ideas on the Target Change system:
I listed earlier that I was going to add Aggro (Aggression) which basically is a number that determines which Creature a monster will attack.
While making this system I quickly realized we will need 2 types of Aggro. Which I have called Threat and Aggro.


Threat:
Threat is a global number per player. Each player will have his own "Threat" level towards creatures. This will determine if a creature will ignore you, attack you, or switch to you. Threat is the #1 thing that creatures will use to decide who they are attacking (unless aggro is a higher number than threat). This means if your tank has a high threat level, creatures will always attack him first. *Unless it is a custom creature that you set up differently*

How threat will work so far: (These are default values and can be changed in config.lua)
  • You will lose 100 threat every 10 seconds.
  • Every step (tile you walk) you will gain 10 threat
  • Every action you will gain 50 threat . (Using an item)
  • When you aggro a creature you will gain 100 threat
  • Every time you kill a creature you will gain 100 threat.
  • in Spells.xml you will be able to add or subtract threat on spell use: threat="100" or threat="-200"
  • in Items.xml you will be able to make items that give you higher/lower base threat or threat per second: basethreat="100" threatgain="-10"
  • Monsters.xml will have <flag ignorethreat="1"> so you can have a monster ignore threat if you want.
  • Monsters.xml will have <flag minthreat="200"> so you can have a monster not attack creatures below that threat level.
Aggro:
Aggro is a unique number that is kept track of on each creature, for each player. This will determine if a SPECIFIC creature will change targets or "prefer" to attack a specific player.

How aggro will work so far: (These are default values and can be changed in monster.xml)
  • You will lose 100 aggro every 10 seconds
  • The damage you do to a creature will increase aggro by 2 PER damage.
  • The damage you do to NEARBY creatures will increase aggro by 1 PER damage. (AoE spells generate a lot of aggro)
  • The healing you do will increase your Aggro by 2 PER hp healed.
  • in Spells.xml you will be able to add or subtract Aggro on spell use: aggro="100" or aggro="-150"
  • in Items.xml you will be able to make items that give you higher/lower base aggro or aggro per second: baseaggro="100" aggrogain="-10"
  • Monsters will have <flag ignoreaggro="1"> in case you want a monster to ignore aggro.
I am also making a new function called getMonsterSpectators(cid) which will grab all players in the monster's view range. (This is so you can use onThink() to make your own customized creature that targets specific players)
Example:
Code:
function onThink(cid, interval)
  local players = getMonsterSpectators(cid)
  local levels = {}
  for _, tid in ipairs(players) do
    if isPlayer(tid) then
      table.insert(levels, getPlayerLevel(tid))
    end
  end
local targets = {}
local highlevel = table.maxn(levels) -- would return the highest leveled player's level
local lowlevels = table.setn(levels, 1)
local lowlevel = table.maxn(lowlevels) -- would return the lowest leveled player's level
  for _, tid in ipairs(players) do
    if isPlayer(tid) then
      if getPlayerLevel(tid) == highlevel then -- Finds the player with highest level(s)
        doMonsterSetTarget(cid, tid) -- Sets target to highest level player
      end
      if getPlayerLevel(tid) == lowlevel then -- Finds the player with the lowest level(s)
        doMonsterSetTarget(cid, tid) -- Sets target to lowest level player
      end
    end
  end
  return true
end
 
Back
Top