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

OTClient New Skill terminal error

Gicu

Well-Known Member
Joined
Feb 26, 2011
Messages
187
Reaction score
52
HI! :p
I created new skill, everything working good but nothing show in OTC.
Client error. When enter game and equiped item with new skill.
36515

What i change in OTC
const.h
Code:
    enum Skill {
        Fist = 0,
        Club,
        Sword,
        Axe,
        Distance,
        Shielding,
        Fishing,
        Newa,
        Newb,
        Newc,
        Newd,
        Newe,
        Newf,
        Newg,
        Newh,
        Newi,
        Newj,
        Newk,
        Newl,
        Newm,
        Newn,
        Newo,
        Newp,
        CriticalChance,
        CriticalDamage,
        LifeLeechChance,
        LifeLeechAmount,
        ManaLeechChance,
        ManaLeechAmount,
        LastSkill
    };

and protocalgameparse.cpp

Code:
void ProtocolGame::parsePlayerSkills(const InputMessagePtr& msg)
{
    int lastSkill = Otc::Newp + 1;
    if(g_game.getFeature(Otc::GameAdditionalSkills))
        lastSkill = Otc::LastSkill;

    for(int skill = 0; skill < lastSkill; skill++) {
        int level;

        if(g_game.getFeature(Otc::GameDoubleSkills))
            level = msg->getU16();
        else
            level = msg->getU8();

        int baseLevel;
        if(g_game.getFeature(Otc::GameSkillsBase))
            if(g_game.getFeature(Otc::GameBaseSkillU16))
                baseLevel = msg->getU16();
            else
                baseLevel = msg->getU8();
        else
            baseLevel = level;

        int levelPercent = 0;
        // Critical, Life Leech and Mana Leech have no level percent
        if(skill <= Otc::Newp)
            levelPercent = msg->getU8();

        m_localPlayer->setSkill((Otc::Skill)skill, level, levelPercent);
        m_localPlayer->setBaseSkill((Otc::Skill)skill, baseLevel);
    }
}



and modules/game_skills/skills.lua


Code:
  local hasAdditionalSkills = g_game.getFeature(GameAdditionalSkills)
  for i = Skill.Fist, Skill.ManaLeechAmount do
    onSkillChange(player, i, player:getSkillLevel(i), player:getSkillLevelPercent(i))
    onBaseSkillChange(player, i, player:getSkillBaseLevel(i))

    if i > Skill.Newp then
      toggleSkill('skillId'..i, hasAdditionalSkills)
    end
  end

  update()

  local contentsPanel = skillsWindow:getChildById('contentsPanel')
  skillsWindow:setContentMinimumHeight(44)
  if hasAdditionalSkills then
    skillsWindow:setContentMaximumHeight(480)
  else
    skillsWindow:setContentMaximumHeight(390)
  end
end


and i add skills.otui


Code:
SkillFirstWidget < UIWidget

SkillButton < UIButton
  height: 21
  margin-bottom: 2
  &onClick: onSkillButtonClick

SmallSkillButton < SkillButton
  height: 14

SkillNameLabel < GameLabel
  font: verdana-11px-monochrome
  anchors.left: parent.left
  anchors.top: parent.top
  anchors.bottom: parent.bottom

SkillValueLabel < GameLabel
  id: value
  font: verdana-11px-monochrome
  text-align: topright
  anchors.right: parent.right
  anchors.top: parent.top
  anchors.bottom: parent.bottom
  anchors.left: prev.left

SkillPercentPanel < ProgressBar
  id: percent
  background-color: green
  height: 5
  margin-top: 15
  anchors.left: parent.left
  anchors.right: parent.right
  anchors.top: parent.top
  phantom: false

MiniWindow
  id: skillWindow
  !text: tr('Skills')
  height: 150
  icon: /images/topbuttons/skills
  @onClose: modules.game_skills.onMiniWindowClose()
  &save: true

  MiniWindowContents
    padding-left: 5
    padding-right: 5
    layout: verticalBox

    SkillButton
      margin-top: 5
      id: experience
      height: 15
      SkillNameLabel
        !text: tr('Experience')
      SkillValueLabel

    SkillButton
      id: level
      SkillNameLabel
        !text: tr('Level')
      SkillValueLabel
      SkillPercentPanel
        background-color: red

    SkillButton
      id: health
      height: 15
      SkillNameLabel
        !text: tr('Punkty Zycia')
      SkillValueLabel

    SkillButton
      id: mana
      height: 15
      SkillNameLabel
        !text: tr('Punkty Energii')
      SkillValueLabel

    SkillButton
      id: soul
      height: 15
      SkillNameLabel
        !text: tr('Dusze')
      SkillValueLabel

    SkillButton
      id: capacity
      height: 15
      SkillNameLabel
        !text: tr('Yang')
      SkillValueLabel

    SkillButton
      id: speed
      height: 15
      SkillNameLabel
        !text: tr('Szybkosc')
      SkillValueLabel

    SkillButton
      id: regenerationTime
      SkillNameLabel
        !text: tr('Regeneration Time')
      SkillValueLabel

    SkillButton
      id: stamina
      SkillNameLabel
        !text: tr('Stamina')
      SkillValueLabel
      SkillPercentPanel

    SkillButton
      id: offlineTraining
      SkillNameLabel
        !text: tr('Offline Training')
      SkillValueLabel
      SkillPercentPanel

    SmallSkillButton
      id: magiclevel
      SkillNameLabel
        !text: tr('Srednie Obrazenia')
      SkillValueLabel

    SmallSkillButton
      id: skillId0
      SkillNameLabel
        !text: tr('Obrazenia dodawane do PZ')
      SkillValueLabel

    SmallSkillButton
      id: skillId1
      SkillNameLabel
        !text: tr('Wartosc Ataku')
      SkillValueLabel

    SmallSkillButton
      id: skillId2
      SkillNameLabel
        !text: tr('Obrazenia Umiejetnosci')
      SkillValueLabel

    SmallSkillButton
      id: skillId3
      SkillNameLabel
        !text: tr('Zrecznosc')
      SkillValueLabel

    SmallSkillButton
      id: skillId4
      SkillNameLabel
        !text: tr('Sila')
      SkillValueLabel

    SmallSkillButton
      id: skillId5
      SkillNameLabel
        !text: tr('Energia Zyciowa')
      SkillValueLabel

    SmallSkillButton
      id: skillId6
      SkillNameLabel
        !text: tr('Szansa na Kryt. Uderzenie')
      SkillValueLabel

    SmallSkillButton
      id: skillId7
      SkillNameLabel
        !text: tr('Inteligencja')
      SkillValueLabel

    SmallSkillButton
      id: skillId8
      SkillNameLabel
        !text: tr('Szansa na Przes. Uderzenie')
      SkillValueLabel

    SmallSkillButton
      id: skillId9
      SkillNameLabel
        !text: tr('Szansa na Otrucie')
      SkillValueLabel

    SmallSkillButton
      id: skillId10
      SkillNameLabel
        !text: tr('Szansa na Omdlenie')
      SkillValueLabel

    SmallSkillButton
      id: skillId11
      SkillNameLabel
        !text: tr('Szansa na Spowolnienie')
      SkillValueLabel

    SmallSkillButton
      id: skillId12
      SkillNameLabel
        !text: tr('Silny przeciwko Ludziom')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId13
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId14
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId15
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId16
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId17
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId18
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId19
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId20
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId21
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel
     
    SmallSkillButton
      id: skillId22
      SkillNameLabel
        !text: tr('A')
      SkillValueLabel


On server side i make all good i edit:
Code:
items.cpp
condition.cpp
enums.h
luascripts.cpp
tools.cpp
iologindata.cpp
vocations.cpp




Maybe i miss something give me some tips :p
 
I make this alone.
This forum is dead.
We can't give much help with this indications:
On server side i make all good i edit:
Code:
items.cpp
condition.cpp
enums.h
luascripts.cpp
tools.cpp
iologindata.cpp
vocations.cpp


We should draw the code in our minds after this indications? One sec let me take the crystal ball...
37313
ops.... it's pointing to NULL
 
We can't give much help with this indications:
On server side i make all good i edit:
Code:
items.cpp
condition.cpp
enums.h
luascripts.cpp
tools.cpp
iologindata.cpp
vocations.cpp


We should draw the code in our minds after this indications? One sec let me take the crystal ball...
View attachment 37313
ops.... it's pointing to NULL
GZ u win goldduck ;)
 
Back
Top