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

Feature New types of DAMAGE (how to create)

what a headache lol, i saw once c++ script where they made it able to change healing numbers etc. configurable at config.lua instead of going into c++
which is also nice for the community i think
How so? For example, in my server I am added COMBAT_LOVEDAMAGE and it has caused popular impress i think. There was, " darkonia" like this
 
How so? For example, in my server I am added COMBAT_LOVEDAMAGE and it has caused popular impress i think. There was, " darkonia" like this

i remember it was something like this in config.lua


healingdamage = 34 (or some other color dunno remember exactly)
 
Hi, I'm having a problem when I add the element to the weapon when I enter the game. It shows me +4 unknow

can you help me ? please
3D25V2f.jpg
 
Hi, I'm having a problem when I add the element to the weapon when I enter the game. It shows me +4 unknow

can you help me ? please
3D25V2f.jpg
There's nothing in this thread about adding it to items.
I'm assuming since it didn't error in the console, you figured out this part:
Code:
} else if (tmpStrValue == "elementfire") {
            Abilities& abilities = it.getAbilities();
            abilities.elementDamage = pugi::cast<uint16_t>(valueAttribute.value());
            abilities.elementType = COMBAT_FIREDAMAGE;
what you forgot is that it has to pull the name of the element from somewhere:
Code:
CombatTypeNames combatTypeNames[] = {
    {"physical",        COMBAT_PHYSICALDAMAGE},
    {"energy",        COMBAT_ENERGYDAMAGE},
    {"earth",        COMBAT_EARTHDAMAGE},
    {"fire",        COMBAT_FIREDAMAGE},
    {"undefined",        COMBAT_UNDEFINEDDAMAGE},
    {"lifedrain",        COMBAT_LIFEDRAIN},
    {"manadrain",        COMBAT_MANADRAIN},
    {"healing",        COMBAT_HEALING},
    {"drown",        COMBAT_DROWNDAMAGE},
    {"ice",            COMBAT_ICEDAMAGE},
    {"holy",        COMBAT_HOLYDAMAGE},
    {"death",        COMBAT_DEATHDAMAGE},
};
add yours here in tools.cpp and it should work.

in item.cpp where it appends text to the item description:
Code:
s << " physical + " << it.abilities->elementDamage << ' ' << getCombatName(it.abilities->elementType);
so you follow getCombatName and you find this:
Code:
std::string getCombatName(CombatType_t combatType)
{
    for (size_t i = 0, size = sizeof(combatTypeNames) / sizeof(CombatTypeNames); i < size; ++i) {
        if (combatTypeNames[i].combat == combatType) {
            return combatTypeNames[i].name;
        }
    }
    return "unknown";
}
obviously the place it gets the name is from the array combatTypeNames which is in tools.cpp. Just follow the code, it always leads you where you want to go :D
 
There's nothing in this thread about adding it to items.
I'm assuming since it didn't error in the console, you figured out this part:
Code:
} else if (tmpStrValue == "elementfire") {
            Abilities& abilities = it.getAbilities();
            abilities.elementDamage = pugi::cast<uint16_t>(valueAttribute.value());
            abilities.elementType = COMBAT_FIREDAMAGE;
what you forgot is that it has to pull the name of the element from somewhere:
Code:
CombatTypeNames combatTypeNames[] = {
    {"physical",        COMBAT_PHYSICALDAMAGE},
    {"energy",        COMBAT_ENERGYDAMAGE},
    {"earth",        COMBAT_EARTHDAMAGE},
    {"fire",        COMBAT_FIREDAMAGE},
    {"undefined",        COMBAT_UNDEFINEDDAMAGE},
    {"lifedrain",        COMBAT_LIFEDRAIN},
    {"manadrain",        COMBAT_MANADRAIN},
    {"healing",        COMBAT_HEALING},
    {"drown",        COMBAT_DROWNDAMAGE},
    {"ice",            COMBAT_ICEDAMAGE},
    {"holy",        COMBAT_HOLYDAMAGE},
    {"death",        COMBAT_DEATHDAMAGE},
};
add yours here in tools.cpp and it should work.

in item.cpp where it appends text to the item description:
Code:
s << " physical + " << it.abilities->elementDamage << ' ' << getCombatName(it.abilities->elementType);
so you follow getCombatName and you find this:
Code:
std::string getCombatName(CombatType_t combatType)
{
    for (size_t i = 0, size = sizeof(combatTypeNames) / sizeof(CombatTypeNames); i < size; ++i) {
        if (combatTypeNames[i].combat == combatType) {
            return combatTypeNames[i].name;
        }
    }
    return "unknown";
}
obviously the place it gets the name is from the array combatTypeNames which is in tools.cpp. Just follow the code, it always leads you where you want to go :D


great! Thank you very much... solved :D :D :D :D

7HbBGPZ.jpg
 
Does not work in TFS 1.4? Tryed but the spell does no damage (when used in spells), and can't add on weapons (says Unknown Key Value)...
 
Does not work in TFS 1.4? Tryed but the spell does no damage (when used in spells), and can't add on weapons (says Unknown Key Value)...
idk if works on tfs 1.4 ... tested with 1.1 and 1.2 and it work..
about the items, I missed it in the tutorial...

RazorBlade resolves it.​

There's nothing in this thread about adding it to items.
I'm assuming since it didn't error in the console, you figured out this part:
Code:
} else if (tmpStrValue == "elementfire") {
            Abilities& abilities = it.getAbilities();
            abilities.elementDamage = pugi::cast<uint16_t>(valueAttribute.value());
            abilities.elementType = COMBAT_FIREDAMAGE;
what you forgot is that it has to pull the name of the element from somewhere:
Code:
CombatTypeNames combatTypeNames[] = {
    {"physical",        COMBAT_PHYSICALDAMAGE},
    {"energy",        COMBAT_ENERGYDAMAGE},
    {"earth",        COMBAT_EARTHDAMAGE},
    {"fire",        COMBAT_FIREDAMAGE},
    {"undefined",        COMBAT_UNDEFINEDDAMAGE},
    {"lifedrain",        COMBAT_LIFEDRAIN},
    {"manadrain",        COMBAT_MANADRAIN},
    {"healing",        COMBAT_HEALING},
    {"drown",        COMBAT_DROWNDAMAGE},
    {"ice",            COMBAT_ICEDAMAGE},
    {"holy",        COMBAT_HOLYDAMAGE},
    {"death",        COMBAT_DEATHDAMAGE},
};
add yours here in tools.cpp and it should work.

in item.cpp where it appends text to the item description:
Code:
s << " physical + " << it.abilities->elementDamage << ' ' << getCombatName(it.abilities->elementType);
so you follow getCombatName and you find this:
Code:
std::string getCombatName(CombatType_t combatType)
{
    for (size_t i = 0, size = sizeof(combatTypeNames) / sizeof(CombatTypeNames); i < size; ++i) {
        if (combatTypeNames[i].combat == combatType) {
            return combatTypeNames[i].name;
        }
    }
    return "unknown";
}
obviously the place it gets the name is from the array combatTypeNames which is in tools.cpp. Just follow the code, it always leads you where you want to go :D
 
you tested with tfs 1.4 ?
Yes, i had to change a couple things but i can't remember where... i created 3 types of physical damage with it, i belive it was in the resistences or something like that, to make it work on weapons. The spell part was flawless
 
Back
Top