Two Problems With Training Machines

Discussion in 'Support' started by Lopaskurwa, Mar 8, 2018.

  1. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
    So i have two problems one is small other is bigger.
    First problem (small)
    [​IMG]
    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 (Text):
    1.  
    2. local combat = createCombatObject()
    3. setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
    4. setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
    5. setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ARROW)
    6.  
    7. function onCastSpell(cid, var)
    8.     doCombat(cid, combat, var)
    9. end
    10.  
    Code (Text):
    1.  
    2. local combat = createCombatObject()
    3. setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
    4. setCombatParam(combat, COMBAT_PARAM_EFFECT, 9)
    5. setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, 3)
    6. setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -0.8, 0, -0.9, 0)
    7.  
    8.  
    9. function onCastSpell(cid, var)
    10. return doCombat(cid, combat, var)
    11.  
    12. end
    13.  
    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.
    [​IMG]
    it should slowly grow when he attacks. Its same think when monsters attack u, your shielding should grow. Ideas?
     
  2. jestem pro

    jestem pro That is the question

    Joined:
    Apr 20, 2013
    Messages:
    520
    Likes Received:
    51
    Best Answers:
    8
    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)
     
  3. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
    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 (Text):
    1.  
    2.     <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">
    3.         <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0" />
    4.         <skill id="0" multiplier="1.5" />
    5.         <skill id="1" multiplier="2.0" />
    6.         <skill id="2" multiplier="2.0" />
    7.         <skill id="3" multiplier="2.0" />
    8.         <skill id="4" multiplier="2.0" />
    9.         <skill id="5" multiplier="1.5" />
    10.         <skill id="6" multiplier="1.1" />
    11.     </vocation>
    All stuffs in creaturescript
    [​IMG]
    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
     
  4. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
  5. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
  6. Xikini

    Xikini I whore myself out for likes

    Joined:
    Nov 17, 2010
    Messages:
    3,569
    Likes Received:
    1,828
    Best Answers:
    80
    Code (Lua):
    1. 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.
     
  7. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
    [​IMG]
    [​IMG]
    Still everything is same that effect doesn't disappear and shielding is not skilling as u can see it always stays at 10
     
  8. Xikini

    Xikini I whore myself out for likes

    Joined:
    Nov 17, 2010
    Messages:
    3,569
    Likes Received:
    1,828
    Best Answers:
    80
    Did you edit the correct script?
    Did you close server, then open again?
    Can you add
    Code (Text):
    1. function onCastSpell(cid, var)
    2.     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?
     
    Lopaskurwa likes this.
  9. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
    o shit sorry my bad now that purple effect is gone. But shielding is still not skilling
     
  10. Xikini

    Xikini I whore myself out for likes

    Joined:
    Nov 17, 2010
    Messages:
    3,569
    Likes Received:
    1,828
    Best Answers:
    80
    Post monster file and current script?
    I'm not sure where we stand.
     
  11. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
    Code (Text):
    1. <monster name="Trainer Android" file="monsters/trainer.xml" />
    Code (Text):
    1.  
    2. <?xml version="1.0"?>
    3. <monster name="Trainer Machine" nameDescription="a Training Machine" level="100" experience="12000" manacost="0" speed="310" race="2">
    4.   <health now="900000000" max="900000000"/>
    5.   <strategy attack="0" defense="0"/>
    6.   <targetchange speed="260" chance="0"/>
    7. <look type="474" head="20" body="30" legs="40" feet="50" addons="0" corpse="2807"/>
    8.  
    9. <flags>
    10.  <flag summonable="0"/>
    11.       <flag attackable="1"/>
    12.       <flag hostile="1"/>
    13.       <flag illusionable="0"/>
    14.       <flag convinceable="0"/>
    15.       <flag pushable="0"/>
    16.      <flag canpushitems="1"/>
    17.       <flag staticattack="50"/>
    18.       <flag lightlevel="0"/>
    19.       <flag lightcolor="0"/>
    20.       <flag targetdistance="1"/>
    21.       <flag runonhealth="0"/>
    22.   </flags>
    23. <attacks>
    24.       <attack name="arrow" interval="2000" chance="100" min="-1" max="-1"/>
    25. <attack name="arrow" interval="2000" chance="100" min="-2" max="-2"/>
    26. <attack name="arrow" interval="2000" chance="100" min="-3" max="-3"/>
    27. <attack name="arrow" interval="2000" chance="100" min="-4" max="-4"/>
    28. <attack name="arrow" interval="2000" chance="100" min="-5" max="-5"/>
    29.   <attack name="bolt" interval="2000" chance="100" min="-1" max="-1"/>
    30. </attacks>
    31.   <defenses defense="0" armor="0"/>
    32.   <immunities/>
    33.  
    34. </monster>
    35.  
     
  12. Xikini

    Xikini I whore myself out for likes

    Joined:
    Nov 17, 2010
    Messages:
    3,569
    Likes Received:
    1,828
    Best Answers:
    80
    Sorry nevermind we are overlooking something super simple.
    Where's your shield / weapon? xDD
     
  13. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
    I don't have one if u talk about items.
     
  14. Xikini

    Xikini I whore myself out for likes

    Joined:
    Nov 17, 2010
    Messages:
    3,569
    Likes Received:
    1,828
    Best Answers:
    80
    Exactly, you can't bring up a skill if you're not equipped with something that can bring up that skill.
     
  15. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
    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 (Text):
    1.  
    2.     <item id="14337" article="a" name="Test">
    3.         <attribute key="description" value="Blalblalbla" />
    4.         <attribute key="weight" value="3000" />
    5.         <attribute key="armor" value="120" />
    6.         <attribute key="skillsword" value="10"/>
    7.         <attribute key="skillaxe" value="10"/>
    8.         <attribute key="skillclub" value="10"/>
    9.         <attribute key="skilldist" value="10"/>
    10.         <attribute key="skillfish" value="10"/>
    11.         <attribute key="skillshield" value="10"/>
    12.         <attribute key="skillfist" value="10"/>
    13.         <attribute key="healthTicks" value="1000"/>
    14.         <attribute key="healthGain" value="400" />
    15.         <attribute key="manaTicks" value="1000"/>
    16.         <attribute key="manaGain" value="400" />
    17.         <attribute key="maxhitpoints" value="3000"/>
    18.         <attribute key="maxmanapoints" value="3000"/>      
    19.         <attribute key="slotType" value="legs" />
    20.     </item>
    Nothing happing to.
     
  16. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
  17. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
  18. Nameless#1337

    Nameless#1337 New Member

    Joined:
    Jul 6, 2016
    Messages:
    16
    Likes Received:
    2
    Best Answers:
    1
    player.cpp

    change;
    Code (Text):
    1.  
    2. void Player::onBlockHit()
    3. {
    4.     if (shieldBlockCount > 0) {
    5.         --shieldBlockCount;
    6.         if (hasShield()){
    7.             addSkillAdvance(SKILL_SHIELD, 1);
    8.         }
    9.     }
    10. }
    11.  
    to

    Code (Text):
    1.  
    2. void Player::onBlockHit()
    3. {
    4.     addSkillAdvance(SKILL_SHIELD, 1);
    5. }
    6.  
     
  19. jigsaw

    jigsaw Member

    Joined:
    Dec 21, 2008
    Messages:
    110
    Likes Received:
    12
    Best Answers:
    4
    Put the shield on and resolve your problem.
     
  20. Lopaskurwa

    Lopaskurwa Member

    Joined:
    Oct 6, 2017
    Messages:
    417
    Likes Received:
    8
    Best Answers:
    2
    Same
    No i need it without any items and items
     

Share This Page

Loading...