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

Two Problems With Training Machines

Lopaskurwa

Active Member
Joined
Oct 6, 2017
Messages
870
Solutions
2
Reaction score
49
So i have two problems one is small other is bigger.
First problem (small)
Untitled.png

Question: How to remove the purple effect because now it put two effects one is that red this one is fine and on top this purple effect, how to remove it?
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)

function onCastSpell(cid, var)
    doCombat(cid, combat, var)
end
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, 9)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 3)
setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.8, 0, -0.9, 0)


function onCastSpell(cid, var)
return doCombat(cid, combat, var)

end
Other problem is bigger when this training machine attack me, my shielding is not "skilling" always stays where he is. Maybe i should make psychal dmg but still if i put energydame so fishing should grow but nothing happening to.
Untitled.png

it should slowly grow when he attacks. Its same think when monsters attack u, your shielding should grow. Ideas?
 
In the second code try to remove the line where is COMBAT_PARAM_EFFECT.

A solution for "the bigger problem" can be everywhere.
Beginning what kind of items you are wearing(maybe protection from all) through what "skill rate" you have configured in config.lua, to speed skilling in vocation.xml.

Or you have a script in creaturescripts related to skills.

It's probably too some problems in database (mysql)
 
In the second code try to remove the line where is COMBAT_PARAM_EFFECT.

A solution for "the bigger problem" can be everywhere.
Beginning what kind of items you are wearing(maybe protection from all) through what "skill rate" you have configured in config.lua, to speed skilling in vocation.xml.

Or you have a script in creaturescripts related to skills.

It's probably too some problems in database (mysql)
COMBAT_PARAM_EFFECT removes only that red effect behind purple, but not that purple effect.
Answers: I was without items, absolutely clean
Rate is
rateExp = 5
rateSkill = 3
rateLoot = 2
rateMagic = 3
rateSpawn = 1
(didn't tried to increase more, because it should grow fast enough with this rate)
I think there is no skilling in vocation.
Code:
    <vocation id="27" name="Test" description="Test" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="2000" basespeed="220" soulmax="100" gainsoulticks="120" fromvoc="27">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
        <skill id="0" multiplier="1.5" />
        <skill id="1" multiplier="2.0" />
        <skill id="2" multiplier="2.0" />
        <skill id="3" multiplier="2.0" />
        <skill id="4" multiplier="2.0" />
        <skill id="5" multiplier="1.5" />
        <skill id="6" multiplier="1.1" />
    </vocation>
All stuffs in creaturescript
Untitled.png

It's still original TFS 1.2 server i haven't change anything big all i did is created new vocation, removed spells, monsters, npc and thats it and otherr stuff is completely original tfs stuff
 
Lua:
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)

COMBAT_ENERGYDAMAGE is making the energy effect.
Energy damage also doesn't count a melee hit.

Change the COMBAT_ENERGYDAMAGE to COMBAT_PHYSICALDAMAGE
and both your problem should be fixed.
 
Lua:
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)

COMBAT_ENERGYDAMAGE is making the energy effect.
Energy damage also doesn't count a melee hit.

Change the COMBAT_ENERGYDAMAGE to COMBAT_PHYSICALDAMAGE
and both your problem should be fixed.
Untitled.png

5a8bbb19

Still everything is same that effect doesn't disappear and shielding is not skilling as u can see it always stays at 10
 
Untitled.png

5a8bbb19

Still everything is same that effect doesn't disappear and shielding is not skilling as u can see it always stays at 10
Did you edit the correct script?
Did you close server, then open again?
Can you add
Code:
function onCastSpell(cid, var)
    print(11111)
and see if it prints to console?

What does the monster file for Trainer Machine look like?

Can you post screenshots of all of the above?
 
Did you edit the correct script?
Did you close server, then open again?
Can you add
Code:
function onCastSpell(cid, var)
    print(11111)
and see if it prints to console?

What does the monster file for Trainer Machine look like?

Can you post screenshots of all of the above?
o shit sorry my bad now that purple effect is gone. But shielding is still not skilling
 
Post monster file and current script?
I'm not sure where we stand.
Code:
<monster name="Trainer Android" file="monsters/trainer.xml" />
Code:
<?xml version="1.0"?>
<monster name="Trainer Machine" nameDescription="a Training Machine" level="100" experience="12000" manacost="0" speed="310" race="2">
  <health now="900000000" max="900000000"/>
  <strategy attack="0" defense="0"/>
  <targetchange speed="260" chance="0"/> 
<look type="474" head="20" body="30" legs="40" feet="50" addons="0" corpse="2807"/>

<flags>
 <flag summonable="0"/>
      <flag attackable="1"/>
      <flag hostile="1"/>
      <flag illusionable="0"/>
      <flag convinceable="0"/>
      <flag pushable="0"/>
     <flag canpushitems="1"/>
      <flag staticattack="50"/>
      <flag lightlevel="0"/>
      <flag lightcolor="0"/>
      <flag targetdistance="1"/>
      <flag runonhealth="0"/>
  </flags> 
<attacks>
      <attack name="arrow" interval="2000" chance="100" min="-1" max="-1"/>
<attack name="arrow" interval="2000" chance="100" min="-2" max="-2"/>
<attack name="arrow" interval="2000" chance="100" min="-3" max="-3"/>
<attack name="arrow" interval="2000" chance="100" min="-4" max="-4"/>
<attack name="arrow" interval="2000" chance="100" min="-5" max="-5"/>
  <attack name="bolt" interval="2000" chance="100" min="-1" max="-1"/>
</attacks>
  <defenses defense="0" armor="0"/>
  <immunities/>

</monster>
 
Sorry nevermind we are overlooking something super simple.
Where's your shield / weapon? xDD
 
Exactly, you can't bring up a skill if you're not equipped with something that can bring up that skill.
But i saw how some servers have it working fine like u can be without items shielding is still skilling. But anyway i tried to add some items like example
Code:
    <item id="14337" article="a" name="Test">
        <attribute key="description" value="Blalblalbla" />
        <attribute key="weight" value="3000" />
        <attribute key="armor" value="120" />
        <attribute key="skillsword" value="10"/>
        <attribute key="skillaxe" value="10"/>
        <attribute key="skillclub" value="10"/>
        <attribute key="skilldist" value="10"/>
        <attribute key="skillfish" value="10"/>
        <attribute key="skillshield" value="10"/>
        <attribute key="skillfist" value="10"/>
        <attribute key="healthTicks" value="1000"/>
        <attribute key="healthGain" value="400" />
        <attribute key="manaTicks" value="1000"/>
        <attribute key="manaGain" value="400" />
        <attribute key="maxhitpoints" value="3000"/>
        <attribute key="maxmanapoints" value="3000"/>       
        <attribute key="slotType" value="legs" />
    </item>
Nothing happing to.
 
player.cpp

change;
Code:
void Player::onBlockHit()
{
    if (shieldBlockCount > 0) {
        --shieldBlockCount;
        if (hasShield()){
            addSkillAdvance(SKILL_SHIELD, 1); 
        }
    }
}

to

Code:
void Player::onBlockHit()
{
    addSkillAdvance(SKILL_SHIELD, 1); 
}
 
player.cpp

change;
Code:
void Player::onBlockHit()
{
    if (shieldBlockCount > 0) {
        --shieldBlockCount;
        if (hasShield()){
            addSkillAdvance(SKILL_SHIELD, 1);
        }
    }
}

to

Code:
void Player::onBlockHit()
{
    addSkillAdvance(SKILL_SHIELD, 1);
}
Same
Put the shield on and resolve your problem.
No i need it without any items and items
 
Back
Top