BE

[OTClient] Shiny Name

Por Benny, 22 de fev. de 2019 em Clients

52
19.6k
JG6J
01 de abril de 2019 às 18:12
20 horas atrás, Lukysz disse:

Alguém Pode me ajudar estou com o mesmo problema que Ayron5 Estava ja tendei tirar a função if string.find(tostring(getCreatureName(cid)), "Shiny") then
      local newName = tostring(getCreatureName(cid)):match("Shiny (.*)")
      return newName
    end

lib/level system.lua

mas não funciono

Alguém Pode me ajuda Porvafor.

 

Retira do Spawn.lua talvez seja lá tbm, são dois arquivos o spawn.lua e o level system.lua

Editado Abril 1 por joaopera

LukyszL
01 de abril de 2019 às 19:28

joaopera

 

tentei mas da erro na distro ou não funciona , onde realmente tenho que mexer ? estou usando base dxp

 

local shinysName = {
"Blastoise", "Venusaur", "Butterfree", "Beedrill", "Pidgeot", "Rattata", "Raticate", "Raichu", "Golbat", "Paras", "Parasect", "Magmar", "Typhlosion", "Xatu", "Growlithe", "Arcanine", "Tentacruel", "Gengar", "Krabby", "Tauros",
"Kingler", "Cubone", "Horsea", "Seadra", "Weezing", "Scyther", "Pinsir", "Crobat", "Zubat", "Tentacool", "Feraligatr", "Machamp", "Meganium", "Alakazam", "Tangela", "Ampharos", "Electabuzz", "Jynx", "Charizard", "Voltorb", "Electrode"}

function onSpawn(cid)
    if getCreatureName(cid) == "" or getCreatureName(cid) == nil then
       setPlayerStorageValue(cid, 510, getCreatureNick(cid))
    end
    
    
    
    --if isTwoGerenetion(doCorrectString(getCreatureName(cid))) then doRemoveCreature(cid) return false end
    registerCreatureEvent(cid, "GeneralConfiguration")
    registerCreatureEvent(cid, "WildAttack")
    registerCreatureEvent(cid, "Experience")
    registerCreatureEvent(cid, "Matou")
    registerCreatureEvent(cid, "PokeWalk")
    registerCreatureEvent(cid, "StatsChange")
    
    if not ehMonstro(cid) then
        registerCreatureEvent(cid, "Target")
        registerCreatureEvent(cid, "Matou")
        registerCreatureEvent(cid, "SummonDeath")
        getPokeDistanceToTeleport(cid)
        setPokemonGhost(cid)
        if getCreatureName(cid):find("Shiny ") then
           setPlayerStorageValue(cid, storages.EhShiny, 1)
        end
    return true
    end
    
    addEvent(doShiny, 5, cid)
    addEvent(adjustWildPoke, 5, cid)
    setPokemonGhost(cid)
    doMarkedPos(cid, getThingPos(cid))
    
       if isPokePassive(cid) then
          setPokemonPassive(cid, true)
       end

return true
end

 

function doShiny(cid)
    if isCreature(cid) then
           if isSummon(cid) then return true end
           if isNpcSummon(cid) then return true end
            local chance = 0
            if isInArray(shinysName, doCorrectString(getCreatureName(cid))) then  --alterado v1.9 \/
               chance = 40    --1% chance  
            end    
            local sid = cid
            if math.random(1, 500) <= chance then  
              doSendMagicEffect(getThingPos(cid), 18)               
              local name, pos = "Shiny ".. getCreatureName(cid), getThingPos(cid)
              if not pokes[name] then return true end
              doRemoveCreature(cid)
              --print(name .. ", " .. retireShinyName(name))
              local shi = doCreateMonsterNick(sid, name, retireShinyName(name), pos, false)          
           end  
    else
                                                               
    return true
    end
end

1 mês depois...
Th3g1m3sT
12 de maio de 2019 às 21:53

Alguem que possa passar um tutorial de como compilar o otc

8 meses depois...
GufiplG
10 de janeiro de 2020 às 12:29

@WaloxComo você copia o código para trabalhar no NPC?

Editado Janeiro 10 por Gufipl

1 mês depois...
LuckXLL
09 de fevereiro de 2020 às 18:11

Capturar.PNG.d45cb945bd87cd26a32b3aa733a635e2.PNG Aqui tá ficando com nomes "bugado" sabe me disser o que pode ser?

3 meses depois...
KaboFlowK
15 de maio de 2020 às 05:19
Em 23/02/2019 em 09:46, Crypter disse:

@XZero

if (drawFlags & Otc::DrawNames) {
	if (g_painter->getColor() != fillColor)
		g_painter->setColor(fillColor);
 
	CachedText shiny;
	shiny.setText("Shiny");
	shiny.setFont(g_fonts.getFont("verdana-11px-rounded"));
	Rect shinyrect = Rect(point.x - shiny.getTextSize().width() / 2.0, textRect.y - 14, shiny.getTextSize());
	if (m_name.find("Shiny") != std::string::npos) {
		std::string eraseName = m_name;
		eraseName.erase(0, 5);
		m_nameCache.setText(eraseName);
		m_nameCache.draw(textRect);
		g_painter->setOpacity(0.5);
		g_painter->setColor(Color(255, 255, 0));
		shiny.draw(shinyrect);
		g_painter->resetColor();
		g_painter->resetOpacity();
		m_nameCache.setText(m_name);
	} else {
		m_nameCache.draw(textRect);
	}
}

 

 

meu 

creature.cpp:

nao tenhe 

 

if (drawFlags & Otc::DrawNames) {
1 mês depois...
kamus9629K
18 de junho de 2020 às 18:00

@Benny

 

Benny e se eu quizer Fazer Sistema fica antes de shiny 

3/5

4/5

5/5

como ficaria ?