Ir para conteúdo
Banner com Efeitos

margosiinho

Membro
  • Registro em

  • Última visita

Tudo que margosiinho postou

  1. Boa tarde, eu uso tfs 0.4 na minha maquina, e consegui umas sources de otx baseadas na versão 0.4, eu compilei, porem quando executo, aparece os erros que estão na imagem, alguem poderia pelo menos me dar um rumo de por onde comeãr a arrumar, ou talvez, um porque desses erros, ja seria de grande ajuda. Até mais.
  2. Desse jeito, a rate é alterada para 50, e não acrescentado 50%
  3. Sim ue, tipo, se minha rate skill esta 4, ao usar o item, ela passa a ser 6 (adicionei 50% da rate a mais) aumentando a rate, se aumenta a velocidade de treinar.
  4. Realmente o item sumiu, porém, ao invés de aumentar 50% da exp que está, ele alterou a exp para 5, meu server usa skill por stages, e quando ele reloga, a skill volta pro stage que estava.
  5. Bacana, eu achei esse script, você consesgue alterar ele pra mim, para aumentar 50% da rate, e o item sumir depois de 24hrs? function onUse(cid, item, fromPosition, itemEx, toPosition) local rate = 50 for i = 0, 7 do doPlayerSetRate(cid, i, rate) -- skills doCreatureSay(cid, "Item usado!", 19) end end <action itemid="2008" script="skillpotion.lua"/> Esse que te passei, ele aumenta 50 nas rates, e nao 50% das rates, e o item nao some, ja tentei colocar 1.5 ao inves de 50, porem ficou foi mais lento para treinar. kk.
  6. Exato !. kk Achei este post Porem o script é para experiencia, e não skills como eu desejo.
  7. Ola pessoal, eu queria um item, uma potion sei la, que quando a pessoa usasse, ela treinasse skill 50% mais rápido que o normal. Grato, boa noite.
  8. Pessoal, uso tfs 0.4/ ot 8.60, quando um player morre ele ta perdendo skill, ta nao ta perdendo muito, mas perde, e nao queria isso, ele perde skill,level e magic level, queria que perdesse somente level. Skill e magic, continuassem os mesmos.. Segue funcao do login.lua e funcao deathloss no config.lua Login.lua function onLogin(cid) registerCreatureEvent(cid, "onPrepareDeathinifi") local loss = getConfigValue('deathLostPercent') if(loss ~= nil) then doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10) Config.lua deathLostPercent = 15 Eu alterei o death loss para 1 e o player voltou pro lvl 1 quando morreu, depois voltei para 15 como estava. Alguem poderia me ajudar?. Eu uso sistema de bless, para nao perder tanto level quando morre, mas perde skill do mesmo modo. Quero que nao perca skill, nem Magic.
  9. Não esta funcionando aqui, TFS 0.4, poderia rever o script? Aqui apresenta os seguintes erros. [16:41:56.170] [Error - GlobalEvent Interface] [16:41:56.177] data/globalevents/scripts/invasion.lua:onThink [16:41:56.181] Description: [16:41:56.185] data/globalevents/scripts/invasion.lua:7: wrong number of arguments [16:41:56.199] stack traceback: [16:41:56.203] [C]: in function 'random' [16:41:56.204] data/globalevents/scripts/invasion.lua:7: in function <data/globalevents/scripts/invasion.lua:1> [16:41:56.206] [Error - GlobalEvents::think] Couldn't execute event: invasion
  10. Ah siim, e que nao consigo achar tutoriais bons que ensine a modificar as tabelas da database. acabo apanhando um pouco para esse quesito.
  11. Aproveitando o tópico, existe alguma forma de acessar o meu phpmyadmin pelo meu pc com windows? Tipo, eu tenho o otserv em linux ubuntu, porem queria acessar o phpmyadmin do meu pc, existe alguma forma pratica de fazer isso? ou não é seguro?
  12. Olá pessoal, tenho um site pronto em modern acc, para meu ot dbo, queria saber se e possivel aplicar um script nele para deixa-lo responsivo, para quando fosse aberto em smartphone, ele se auto redirecionasse para a resolução do celular.
  13. Bom dia pessoal, estou finalizando um otserv depois de meses de trabalho, servidor 8.60 com site, porem estou com uma duvida gigantesca e nao achei algo parecido com minha duvida, depois que eu compilar e instalar apache,mysql,phpmyadmin, como farei para alterar dados dentro da database? suponhamos que eu queria alterar a permissão de um player, ou ate mesmo alterar mana e life dentro da db, como farei isso pelo terminal? alguem tem link de algum tutorial ou nã se importaria em me dar dicas rápidas? Desde já agradeço.
  14. Caramba kkkk, muito obrigado.
  15. Olá pessoal do TK, estou com um problema no meu shop system, na parte admin, quando coloco o nome do player, ou seleciono ele, e coloco o numero de points que quero adicionar a conta do mesmo, simplesmente nao acontece nada, nenhum erro, não adiciona os pontos. Alguem sabe oque pode ser? Vou postar, meu gifts.
  16. Olá pessoal, eu tenho um npc chamado dederin no meu ot 8.6, porem ele nao exige premium, eu queria que ele exigisse premium dos players, e que removesse 1 gold a cada viagem que ele fizesse para as cidades, atualmente para ele viajar, eu preciso apresentar um ticket para outro npc (boater) para ele me conceder a permissão de viajar. Não quero que ele me conceda isso, só quero que o npc DEDERIN verifique se o player e vip, e se for cobrar 1 gold para cada viagem, vou postar o script do npc. local STORAGE = 4150 -- Storage necessária para viajar local smallcity = {x=107, y=200, z=7} local namekisland = {x=461, y=447, z=5} local bigcity = {x=117, y=102, z=7} local icecity = {x=315, y=179, z=7} local frozencity = {x=477, y=643, z=7} local westisland = {x=83, y=39, z=7} local eastisland = {x=111, y=39, z=7} local brokencity = {x=99, y=343, z=7} local assassintower = {x=254, y=393, z=7} local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg:lower()) end function onThink() npcHandler:onThink() end local talkState = {} function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, "travel") then selfSay("Eu posso te levar para {Small City}, {Namek Island}, {Big City}, {Ice City}, {Frozen City}, {West Island}, {East Island}, {Broken City}, {Assassin Tower} e {Castle War}.", cid) end if msgcontains(msg, "small city") then selfSay("Voce realmente quer viajar para {Small City}?", cid) talkState[talkUser] = 1 elseif msgcontains(msg, "yes") and talkState[talkUser] == 1 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, smallcity) doSendMagicEffect(smallcity, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end if msgcontains(msg, "namek island") then selfSay("Voce realmente quer viajar para {Namek Island}?", cid) talkState[talkUser] = 2 elseif msgcontains(msg, "yes") and talkState[talkUser] == 2 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, namekisland) doSendMagicEffect(namekisland, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end if msgcontains(msg, "big city") then selfSay("Voce realmente quer viajar para {Big City}?", cid) talkState[talkUser] = 3 elseif msgcontains(msg, "yes") and talkState[talkUser] == 3 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, bigcity) doSendMagicEffect(bigcity, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end if msgcontains(msg, "ice city") then selfSay("Voce realmente quer viajar para {Ice City}?", cid) talkState[talkUser] = 4 elseif msgcontains(msg, "yes") and talkState[talkUser] == 4 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, icecity) doSendMagicEffect(icecity, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end if msgcontains(msg, "frozen city") then selfSay("Voce realmente quer viajar para {Frozen City}?", cid) talkState[talkUser] = 5 elseif msgcontains(msg, "yes") and talkState[talkUser] == 5 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, frozencity) doSendMagicEffect(frozencity, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end if msgcontains(msg, "west island") then selfSay("Voce realmente quer viajar para {West Island}?", cid) talkState[talkUser] = 6 elseif msgcontains(msg, "yes") and talkState[talkUser] == 6 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, westisland) doSendMagicEffect(westisland, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end if msgcontains(msg, "east island") then selfSay("Voce realmente quer viajar para {East Island}?", cid) talkState[talkUser] = 7 elseif msgcontains(msg, "yes") and talkState[talkUser] == 7 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, eastisland) doSendMagicEffect(eastisland, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end if msgcontains(msg, "broken city") then selfSay("Voce realmente quer viajar para {Broken City}?", cid) talkState[talkUser] = 8 elseif msgcontains(msg, "yes") and talkState[talkUser] == 8 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, brokencity) doSendMagicEffect(brokencity, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end if msgcontains(msg, "assassin tower") then selfSay("Voce realmente quer viajar para {Assassin Tower}?", cid) talkState[talkUser] = 9 elseif msgcontains(msg, "yes") and talkState[talkUser] == 9 then if getPlayerStorageValue(cid,4150) == 1 then if not isPlayerPzLocked(cid) then doSendMagicEffect(getThingPos(cid), 10) npcHandler:releaseFocus(cid) doTeleportThing(cid, assassintower) doSendMagicEffect(assassintower, 10) else selfSay("Voce deve estar sem pz locked!", cid) end elseif getPlayerStorageValue(cid,4150) ~= 1 then selfSay("Desculpe, voce nao possui passagem!", cid) end talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  17. Hm.. Qual versão do xampp esta usando?
  18. Ele nao esta encontrando a tabela "newsticker". Vamos cria-la. Abra o phpmyadmin, abra sua database, depois clique na opção SQL, e execute o seguinte código. Feito isso teste novamente. CREATE TABLE IF NOT EXISTS `newsticker` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(150) DEFAULT '', `body` text, `time` int(11) DEFAULT '0', PRIMARY KEY (`id`) );
  19. Troca sua database.
  20. Ja tive este erro, so resolveu trocando a database, use a do dbohunter, ira resolver o problema.
  21. Galera, estou editando um site de modern acc, ja resolvi alguns problemas, mas tem um que nao estou conseguindo, ele simplesmente cria somente uma conta, depois se for criar outra fala que o apelido ja existe. vou posta meu account.php e character.php caso alguém se disponibilize a dar uma olhada, ficarei grato. Account.php <?php /* +I.D.E ENGINE+ Controller of Account for Modern AAC - Powered by IDE Engine. A lot of new functionality and variables can be hard-coded here. If you do NOT understand the code, do NOT change anything in here. */ class Account extends Controller { /* Main index of Account controllers, also work as a __construct(); It is called by engine as a default. */ function index($action = 0) { if($action == 1) success("Seu novo personagem foi criado!"); if($action == 2) success("Seu apelido foi criado! obrigado!"); if($action == 3) success("Você Exedel a quantidade máxima de caracteres por conta."); if($action == 4) success("Seu perfil foi atualizado."); if($action == 5) success("Seu avatar foi atualizado!"); $this->load->model("Account_model"); if(empty($_SESSION['account_id'])) $_SESSION['account_id'] = $this->Account_model->getAccountID(); $ide = new IDE; $ide->requireLogin(); if(empty($_SESSION['nickname'])) $ide->redirect(WEBSITE."/index.php/account/setNickname"); $data = array(); $data['loggedUser'] = $_SESSION['name']; $data['characters'] = $this->Account_model->getCharacters(); $data['messages'] = $this->Account_model->checkMessages(); $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $account = $ots->createObject('Account'); try { $account->find($_SESSION['name']); } catch(Exception $e) {show_error('Houve um problema durante o carregamento da conta. Err code: 220212072010 mais detalhes: '.$e->getMessage());} $data['account'] = $account; $data['acc'] = $this->Account_model->load($_SESSION['account_id']); $recovery_key = $this->Account_model->getRecoveryKey($_SESSION['name']); if($recovery_key === "") alert("You don't have recovery key set up. Click <a href='".WEBSITE."/index.php/account/generate_recovery_key'><b>here</b></a> to create one. We strongly recommend to create one now for security reasons."); /* Load view of account page and send data to it. */ $this->load->view('account', $data); } /* Function to check if account with this name already exists, it is used by create controller as a callaback in form validation. It should be made as an abstract class of database in Model, but I don't think there is point of it. */ function _account_exists($name) { $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $account = new OTS_Account(); try { $account->find($name); } catch(Exception $e) {show_error('Houve um problema durante o carregamento da conta. Err code: 220212072010 mais detalhes: '.$e->getMessage());} if($account->isLoaded()) { $this->form_validation->set_message('_account_exists', 'Conta com este nome já existe.');return false;} else return true; } function _checkCaptcha($word) { if(strtolower($word) == strtolower($_SESSION['captcha']) && !empty($_SESSION['captcha'])) { return true; } else { $this->form_validation->set_message('_checkCaptcha', 'Captcha word está incorreta.'); return false; } } function _nicknameExists($name) { $this->load->model("account_model"); if($this->account_model->nicknameExists($name)) { $this->form_validation->set_message('_nicknameExists', 'Esse apelido ja existe.'); return false; } else return true; } function _emailExists($email) { $this->load->model("account_model"); if($this->account_model->emailExists($email)) { $this->form_validation->set_message('_emailExists', 'Este e-mail ja está sendo usado por outra conta.'); return false; } else return true; } function _characterExists($name) { $this->load->model("character_model"); if($this->character_model->characterExists($name)) { $this->form_validation->set_message('_characterExists', 'Já existe um personagem com esse nome, por favor escolha outro.'); return false; } else return true; } function _checkDelay() { global $config; if(!isset($_SESSION['accountDelay'])) $_SESSION['accountDelay'] = 0; if($config['accountDelay']) { if(@(time()-$_SESSION['accountDelay']) > 240) { return true; } else { $this->form_validation->set_message('_checkDelay', 'Você não pode criar outra conta agora, por favor espere.'); return false; } } else return true; } function _checkCity($id) { $this->config->load('create_character.php'); if(!array_key_exists($id, $this->config->item('cities'))) { $this->form_validation->set_message('_checkCity', 'Unknown City'); return false; } else return true; } function _checkWorld($id) { $this->config->load('create_character.php'); if(!array_key_exists($id, $this->config->item('worlds'))) { $this->form_validation->set_message('_checkWorld', 'Unknown World'); return false; } else return true; } function _checkVocation($id) { $this->config->load('create_character.php'); if(!array_key_exists($id, $this->config->item('vocations'))) { $this->form_validation->set_message('_checkVocation', 'Unknown Vocation'); return false; } else return true; } function _checkSex($id) { if($id != 0 and $id != 1) { $this->form_validation->set_message('_checkSex', 'Unknown Sex'); return false; } else return true; } function _validName($name) { require("config.php"); global $config; $name = explode(" ", $name); foreach($name as $unit) { if(in_array(strtolower($unit), $config['invalidNameTags'])) { $this->form_validation->set_message('_validName', 'Invalid Name'); return false; } else if(strlen($unit) == 1) { $this->form_validation->set_message('_validName', 'Invalid Name'); return false; } else continue; } } // Function which make the player more real by tatu hunter // Eg: elder'Druid = Locaa // elder'druid = Elder'druid // druid theMaster = Druid themaster function strFirst($name) { $name = explode(' ', trim($name)); for($i=0, $t = sizeof($name); $i<$t; ++$i) for($j=0, $l=strlen($name[$i]); $j<$l; ++$j) !$j ? ($name[$i][$j] = !$i ? ($name[$i][$j] == strtoupper($name[$i][$j]) ? $name[$i][$j] : strtoupper($name[$i][$j])): $name[$i][$j]) : ($name[$i][$j] = ($name[$i][$j-1] == '\'' ? $name[$i][$j] : strtolower($name[$i][$j]))); $ret = ''; foreach($name as $k) $ret .= $k . ' '; return trim($ret); } /* Controller of creating new account. New values can be hard-coded here. (only experienced users) */ function create($ajax = 0) { require_once("system/application/config/create_character.php"); $ide = new IDE; global $config; if($ajax == 1 && $ide->isLogged()) exit; if($ide->isLogged()) $ide->redirect(WEBSITE.'/index.php/account'); $this->load->plugin('captcha'); $this->load->helper('form'); $vals = array( 'word' => '', 'img_path' => 'system/captcha/', 'img_url' => WEBSITE.'/system/captcha/', 'font_path' => WEBSITE.'/system/fonts/texb.ttf', 'img_width' => '156', 'img_height' => 30, 'expiration' => 120 ); if(!$_POST && $ajax == 0) { $cap = create_captcha($vals); } if($_POST) { $this->load->library('form_validation'); $_POST['nickname'] = ucfirst(strtolower($_POST['nickname'])); $this->form_validation->set_rules('name', 'Account Name', 'required|min_length[4]|max_length[32]|callback__account_exists|alpha_numeric|callback__checkDelay'); $this->form_validation->set_rules('nickname', 'Nickname', 'required|min_length[4]|max_length[32]|callback__nicknameExists'); $this->form_validation->set_rules('password', 'Password', 'required|matches[repeat]|min_length[4]|max_length[255]'); $this->form_validation->set_rules('email', 'Email', 'required|valid_email|callback__emailExists'); $this->form_validation->set_rules('character_name', 'Character Name', 'required|min_length[4]|max_length[32]|nickname|callback__characterExists|callback__validName'); $this->form_validation->set_rules('city', 'City', 'required|integer|callback__checkCity'); $this->form_validation->set_rules('world', 'World', 'required|integer|callback__checkWorld'); $this->form_validation->set_rules('vocation', 'Vocation', 'required|integer|callback__checkVocation'); $this->form_validation->set_rules('sex', 'Sex', 'required|integer|callback__checkSex'); $this->form_validation->set_rules('captcha', 'Captcha', 'required|callback__checkCaptcha'); if($this->form_validation->run() == TRUE) { require(APPPATH.'config/ide_default.php'); $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $account = new OTS_Account(); $name = $account->createNamed($_POST['name']); $account->setPassword(sha1($_POST['password'])); $account->setEmail($_POST['email']); $account->setCustomField('nickname', $_POST['nickname']); $account->setCustomField('premdays', PREMDAYS); $account->setCustomField('lastday', $_SERVER['REQUEST_TIME']); try { $account->save(); unset($account); $_SESSION['logged'] = 1; $_SESSION['name'] = $_POST['name']; $_SESSION['nickname'] = $_POST['nickname']; $_SESSION['accountDelay'] = time(); $account = $ots->createObject('Account'); $account->find($_POST['name']); $sample = new OTS_Player(); $sample->find($config['newchar_vocations'][$_POST['world']][$_POST['vocation']]); if(!$sample->isLoaded()) { show_error('Sample character could not be found!'); } // Create new character $player = $ots->createObject('Player'); $player->setName($this->strFirst($_POST['character_name'])); $player->setAccount($account); $player->setWorld($_POST['world']); $player->setGroup($sample->getGroup()); $player->setSex($_POST['sex']); $player->setVocation($sample->getVocation()); $player->setConditions($sample->getConditions()); $player->setRank($sample->getRank()); $player->setLookAddons($sample->getLookAddons()); $player->setTownId($_POST['city']); $player->setExperience($sample->getExperience()); $player->setLevel($sample->getLevel()); $player->setMagLevel($sample->getMagLevel()); $player->setHealth($sample->getHealth()); $player->setHealthMax($sample->getHealthMax()); $player->setMana($sample->getMana()); $player->setManaMax($sample->getManaMax()); $player->setManaSpent($sample->getManaSpent()); $player->setSoul($sample->getSoul()); $player->setDirection($sample->getDirection()); $player->setLookBody($sample->getLookBody()); $player->setLookFeet($sample->getLookFeet()); $player->setLookHead($sample->getLookHead()); $player->setLookLegs($sample->getLookLegs()); $player->setLookType($sample->getLookType()); $player->setCap($sample->getCap()); $player->setPosX($startPos['x']); $player->setPosY($startPos['y']); $player->setPosZ($startPos['z']); $player->setLossExperience($sample->getLossExperience()); $player->setLossMana($sample->getLossMana()); $player->setLossSkills($sample->getLossSkills()); $player->setLossItems($sample->getLossItems()); $player->setLossContainers($sample->getLossContainers()); $player->save(); $_SESSION['characterDelay'] = $_SERVER['REQUEST_TIME']; unset($player); $player = $ots->createObject('Player'); $player->find($_POST['character_name']); if($player->isLoaded()) { $player->setSkill(0,$sample->getSkill(0)); $player->setSkill(1,$sample->getSkill(1)); $player->setSkill(2,$sample->getSkill(2)); $player->setSkill(3,$sample->getSkill(3)); $player->setSkill(4,$sample->getSkill(4)); $player->setSkill(5,$sample->getSkill(5)); $player->setSkill(6,$sample->getSkill(6)); $player->save(); $SQL = POT::getInstance()->getDBHandle(); $loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$sample->getId().""); foreach($loaded_items_to_copy as $save_item) $SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');"); if($ajax == 0) $ide->redirect(WEBSITE.'/index.php/account'); else $ide->criticalRedirect(WEBSITE.'/index.php/account'); } } catch(Exception $e) { error($e->getMessage()); } } else { if($ajax == 0) $cap = create_captcha($vals); } } if($ajax == 0) { $_SESSION['captcha'] = $cap['word']; $data['captcha'] = $cap['image']; } #Load view of creating account if($ajax == 1) { echo error(validation_errors()); $ide->system_stop(); } else { $this->load->view('create', $data); } } /* Function to check if passed login and password are correct, it uses abstract database model. */ function _check_login() { $this->load->model("Account_model"); if($this->Account_model->check_login() == false) { $this->form_validation->set_message("_check_login", "Account name or password are incorrect."); return false; } else return true; } /* Login controller */ function login($action = 0) { if((int) $action == 1) success("You have been logged out."); if((int) $action == 2) success("Your account has been recovered. You may login now."); $ide = new IDE; $this->load->helper("form"); $this->load->library("form_validation"); if($_POST) { $this->form_validation->set_rules('name', 'Account Name', 'required|callback__check_login'); $this->form_validation->set_rules('pass', 'Password', 'required'); if(in_array($_POST['name'], $GLOBALS['config']['restrictedAccounts'])) error("The account you try to access is restricted!"); else { if($this->form_validation->run() == true) { $_SESSION['logged'] = 1; $_SESSION['name'] = $_POST['name']; if(!empty($_SESSION['forward'])) { $forward = $_SESSION['forward']; $_SESSION['forward'] = ""; $ide->redirect($forward); } else $ide->redirect(WEBSITE.'/index.php/account'); } } } /* Load view of login page. */ $this->load->view("login"); } /* Function to logout from account. */ function logout() { $ide = new IDE; $_SESSION['logged'] = ''; $_SESSION['account_id'] = ''; $_SESSION['name'] = ''; $_SESSION['admin'] = 0; $_SESSION['forward'] = ""; $ide->redirect('login/1'); } /* Controller to generate random recovery key and save it, accessed by user, only once per account. */ function generate_recovery_key() { $this->load->helper("form"); $ide = new IDE; $ide->requireLogin(); $this->load->model("Account_model"); if($this->Account_model->getRecoveryKey($_SESSION['name'])) { alert("<b>You can't generate a new KEY</b>"); return false; } if($_POST) { $data['info'] = ''; $key = $this->Account_model->generateKey($_SESSION['name']); success("<center><font size='4'>$key</font></center>"); alert("<b>Save this recovery key, you see this key only once! You will never see it again, don't refresh or move away from this website until you save it!</b>"); } else $data['info'] = '<center id=\'info\'><b>Press this button to generate your unique recovery key. <br>Remember! You can do this only once! Your recovery key will be shown only once! Write it down, for security reasons we recommend to not save it on computers hard drive!</b></center><br><center><input type=\'submit\' value=\'Generate\' name=\'submit\'></center>'; /* Load view of generating new recovery key. */ $this->load->view('generate_recovery_key', $data); } function _checkCurrentPassword($pass) { $this->load->model("account_model"); if($this->account_model->checkPassword($pass)) return true; else { $this->form_validation->set_message("_checkCurrentPassword", "Current password is incorrect."); return false; } } function changepassword() { $ide = new IDE; $ide->requireLogin(); $this->load->helper("form_helper"); if($_POST) { $this->load->library("form_validation"); $this->form_validation->set_rules('current', 'Current Password', 'required|callback__checkCurrentPassword'); $this->form_validation->set_rules('password', 'Password', 'required|matches[repeat]|min_length[4]|max_length[255]'); if($this->form_validation->run() == true) { $this->load->model("account_model"); $this->account_model->changePassword($_POST['password'], $_SESSION['name']); success("Your password has been changed."); $ide->redirect(WEBSITE."/index.php/account", 2); } } $this->load->view("changepassword"); } function editcomment($id) { $ide = new IDE; $ide->requireLogin(); if(empty($id)) $ide->redirect(WEBSITE."/index.php/account"); $this->load->model("account_model"); if(!$this->account_model->isUserPlayer($id)) $ide->redirect(WEBSITE."/index.php/account"); $data['id'] = $id; if($_POST) { $this->load->library("form_validation"); $this->form_validation->set_rules('comment', 'Comment', 'max_length[255]|alpha_ide'); if($this->form_validation->run() == true) { if(@$_POST['hide'] == 1) $this->account_model->changeComment($id, $_POST['comment'], true); else $this->account_model->changeComment($id, $_POST['comment'], false); success("Your comment has been changed."); $ide->redirect(WEBSITE."/index.php/account", 2); } } $data['comment'] = $this->account_model->getPlayerComment($id); $this->load->helper("form_helper"); $this->load->view("edit_comment", $data); } function deletePlayer($id) { $ide = new IDE; $ide->requireLogin(); $id = (int)$id; if(empty($id)) $ide->redirect(WEBSITE."/index.php/account"); $this->load->model("account_model"); if(!$this->account_model->isUserPlayer($id)) $ide->redirect(WEBSITE."/index.php/account"); $this->account_model->deletePlayer($id); $ide->redirect(WEBSITE."/index.php/account"); } public function setNickname() { $ide = new IDE; $ide->requireLogin(); if(!empty($_SESSION['nickname'])) $ide->goPrevious(); $this->load->helper("form_helper"); if($_POST) { $_POST['nickname'] = ucfirst(strtolower($_POST['nickname'])); $this->load->library("form_validation"); $this->form_validation->set_rules('nickname', 'Nickname', 'required|min_length[4]|max_length[32]|nickname|callback__nicknameExists'); $this->form_validation->set_rules('rules', 'Rules', 'required'); if($this->form_validation->run()) { $this->load->model("account_model"); $this->account_model->setNickname($ide->loggedAccountId(), $_POST['nickname']); $_SESSION['nickname'] = $_POST['nickname']; $ide->redirect(WEBSITE."/index.php/account/index/2"); } } $this->load->view("setNickname"); } function _validKey($key) { $this->load->model("account_model"); $_POST['key'] = str_replace("-", "", $_POST['key']); if($this->account_model->checkKey($_POST['key'], $_POST['email'])) { return true; } else { $this->form_validation->set_message("_validKey", "Could not change password. Make sure email and recovery key are valid."); return false; } } public function lost() { $ide = new IDE; $this->load->helper("form_helper"); if($_POST) { $_POST['key'] = str_replace("-", "", $_POST['key']); $this->load->library("form_validation"); $this->form_validation->set_rules('password', 'Password', 'required|matches[repeat]|min_length[4]|max_length[255]'); $this->form_validation->set_rules('email', 'Email', 'required|valid_email'); $this->form_validation->set_rules('key', 'Recovery Key', 'required|callback__validKey'); if($this->form_validation->run()) { $this->load->model("account_model"); $this->account_model->recoveryAccount($_POST['key'], $_POST['email'], $_POST['password']); $ide->redirect(WEBSITE."/index.php/account/login/2"); } } $this->load->view("account_lost"); } } ?> Agora o character.php <?php class Character extends Controller { function index() { parent::Controller(); } function _characterExists($name) { $this->load->model("character_model"); if($this->character_model->characterExists($name)) { $this->form_validation->set_message('_characterExists', 'This character name already exists, please choose another one!'); return false; } else return true; } function _checkCity($id) { $this->config->load('create_character.php'); if(!array_key_exists($id, $this->config->item('cities'))) { $this->form_validation->set_message('_checkCity', 'Unknown City'); return false; } else return true; } function _checkWorld($id) { $this->config->load('create_character.php'); if(!array_key_exists($id, $this->config->item('worlds'))) { $this->form_validation->set_message('_checkWorld', 'Unknown World'); return false; } else return true; } function _checkVocation($id) { $this->config->load('create_character.php'); if(!array_key_exists($id, $this->config->item('vocations'))) { $this->form_validation->set_message('_checkVocation', 'Unknown Vocation'); return false; } else return true; } function _checkSex($id) { if($id != 0 and $id != 1) { $this->form_validation->set_message('_checkSex', 'Unknown Sex'); return false; } else return true; } function _checkDelay() { global $config; if(!isset($_SESSION['characterDelay'])) $_SESSION['characterDelay'] = 0; if($config['characterDelay']) { if(@(time()-$_SESSION['characterDelay']) > 240) { return true; } else { $this->form_validation->set_message('_checkDelay', 'You cannot create another character just after another. Please wait few minutes.'); return false; } } else return true; } function _validName($name) { require("config.php"); global $config; $name = explode(" ", $name); foreach($name as $unit) { if(in_array(strtolower($unit), $config['invalidNameTags'])) { $this->form_validation->set_message('_validName', 'Invalid Name'); return false; } else if(strlen($unit) == 1) { $this->form_validation->set_message('_validName', 'Invalid Name'); return false; } else continue; } } // Function which make the player more real by tatu hunter // Eg: elder'Druid = Elder'Druid // elder'druid = Elder'druid // druid theMaster = Druid themaster function strFirst($name) { $name = explode(' ', trim($name)); for($i=0, $t = sizeof($name); $i<$t; ++$i) for($j=0, $l=strlen($name[$i]); $j<$l; ++$j) !$j ? ($name[$i][$j] = !$i ? ($name[$i][$j] == strtoupper($name[$i][$j]) ? $name[$i][$j] : strtoupper($name[$i][$j])): $name[$i][$j]) : ($name[$i][$j] = ($name[$i][$j-1] == '\'' ? $name[$i][$j] : strtolower($name[$i][$j]))); $ret = ''; foreach($name as $k) $ret .= $k . ' '; return trim($ret); } function create_character($ajax = 0) { require_once("system/application/config/create_character.php"); global $config; global $ide; $data['worlds'] = $config['worlds']; $data['cities'] = $config['cities']; $data['vocations'] = $config['vocations']; $this->load->model("character_model"); $count = $this->character_model->getCount(); if($count >= $config['maxCharacters'] && $ajax == 1) exit; if($count >= $config['maxCharacters']) $ide->redirect(WEBSITE."/index.php/account/index/3"); $this->load->helper('form'); $this->load->library('form_validation'); if($_POST) { $_POST['name'] = trim(ucwords(strtolower(decodeString($_POST['name'])))); $this->form_validation->set_rules('name', 'Player Name', "required|min_length[3]|max_length[20]|nickname|callback__characterExists|callback__validName|callback__checkDelay"); $this->form_validation->set_rules('city', 'City', 'required|integer|callback__checkCity'); $this->form_validation->set_rules('world', 'World', 'required|integer|callback__checkWorld'); $this->form_validation->set_rules('vocation', 'Vocation', 'required|integer|callback__checkVocation'); $this->form_validation->set_rules('sex', 'Sex', 'required|integer|callback__checkSex'); if($this->form_validation->run() == true) { $ide = new IDE; $char_to_copy_name = $config['newchar_vocations'][$_POST['world']][$_POST['vocation']]; $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $char_to_copy = new OTS_Player(); $char_to_copy->find($char_to_copy_name); $this->load->model("character_model"); /* This code (Most of it actually) has been taken from Gesior AAC. */ $account_logged = $ots->createObject('Account'); $account_logged->load($this->character_model->getAccountID()); if(!$char_to_copy->isLoaded()) { show_error('Sample character could not be found!'); } if($_POST['sex'] == "0") $char_to_copy->setLookType(136); $player = $ots->createObject('Player'); $player->setName($this->strFirst($_POST['name'])); $player->setAccount($account_logged); $player->setWorld($_POST['world']); $player->setGroup($char_to_copy->getGroup()); $player->setSex($_POST['sex']); $player->setVocation($char_to_copy->getVocation()); $player->setConditions($char_to_copy->getConditions()); $player->setRank($char_to_copy->getRank()); $player->setLookAddons($char_to_copy->getLookAddons()); $player->setTownId($_POST['city']); $player->setExperience($char_to_copy->getExperience()); $player->setLevel($char_to_copy->getLevel()); $player->setMagLevel($char_to_copy->getMagLevel()); $player->setHealth($char_to_copy->getHealth()); $player->setHealthMax($char_to_copy->getHealthMax()); $player->setMana($char_to_copy->getMana()); $player->setManaMax($char_to_copy->getManaMax()); $player->setManaSpent($char_to_copy->getManaSpent()); $player->setSoul($char_to_copy->getSoul()); $player->setDirection($char_to_copy->getDirection()); $player->setLookBody($char_to_copy->getLookBody()); $player->setLookFeet($char_to_copy->getLookFeet()); $player->setLookHead($char_to_copy->getLookHead()); $player->setLookLegs($char_to_copy->getLookLegs()); $player->setLookType($char_to_copy->getLookType()); $player->setCap($char_to_copy->getCap()); $player->setPosX($startPos['x']); $player->setPosY($startPos['y']); $player->setPosZ($startPos['z']); $player->setLossExperience($char_to_copy->getLossExperience()); $player->setLossMana($char_to_copy->getLossMana()); $player->setLossSkills($char_to_copy->getLossSkills()); $player->setLossItems($char_to_copy->getLossItems()); $player->setLossContainers($char_to_copy->getLossContainers()); $player->save(); $_SESSION['characterDelay'] = time(); unset($player); $player = $ots->createObject('Player'); $player->find($_POST['name']); if($player->isLoaded()) { $player->setCustomField('world_id', (int) $_POST['world']); $player->setSkill(0,$char_to_copy->getSkill(0)); $player->setSkill(1,$char_to_copy->getSkill(1)); $player->setSkill(2,$char_to_copy->getSkill(2)); $player->setSkill(3,$char_to_copy->getSkill(3)); $player->setSkill(4,$char_to_copy->getSkill(4)); $player->setSkill(5,$char_to_copy->getSkill(5)); $player->setSkill(6,$char_to_copy->getSkill(6)); $player->save(); $SQL = POT::getInstance()->getDBHandle(); $loaded_items_to_copy = $SQL->query("SELECT * FROM player_items WHERE player_id = ".$char_to_copy->getId().""); foreach($loaded_items_to_copy as $save_item) $SQL->query("INSERT INTO `player_items` (`player_id` ,`pid` ,`sid` ,`itemtype`, `count`, `attributes`) VALUES ('".$player->getId()."', '".$save_item['pid']."', '".$save_item['sid']."', '".$save_item['itemtype']."', '".$save_item['count']."', '".$save_item['attributes']."');"); if($ajax == 0) $ide->redirect(WEBSITE.'/index.php/account/index/1'); else $ide->criticalRedirect(WEBSITE.'/index.php/account/index/1'); } } } if($ajax == 1) { error(validation_errors()); $ide->system_stop(); } else $this->load->view('create_character', $data); } public function view($name = null) { global $config; if(!@is_array($_SESSION['sCharacters'])) $_SESSION['sCharacters'] = array(); $ide = new IDE; if(!empty($name)) { $name = decodeString($name); $data['character'] = $name; $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $player = $ots->createObject('Player'); $player->find($name); if(!$player->isLoaded()) { $ide->redirect("../../character/view/"); } else { if(!in_multiarray($name, $_SESSION['sCharacters'])) { array_unshift($_SESSION['sCharacters'], array("name"=>$name, "time"=>time())); if(count($_SESSION['sCharacters']) > $config['characterSearchLimit']) array_pop($_SESSION['sCharacters']); } $data['player'] = $player; $data['account'] = $player->getAccount(); } $this->load->view('view_character.php', $data); } else { $this->load->helper("form"); if($_POST) { $name = decodeString($_POST['name']); $ots = POT::getInstance(); $ots->connect(POT::DB_MYSQL, connection()); $player = new OTS_Player(); $player->find($name); if($player->isLoaded()) { $ide->redirect("../character/view/$name"); } else { error("$name could not be found."); } } $this->load->view('character_search.php'); } } public function online() { $this->load->helper('form'); $this->load->model("character_model"); $data['players'] = $this->character_model->getPlayersOnline(); $this->load->view("online_players.php", $data); } public function clearHistory() { global $ide; $_SESSION['sCharacters'] = array(); echo "History Cleared!"; $ide->system_stop(); } } ?>
  22. Galera, meu server wodbo 8.0 (versao dbko) esta com um bug no skill de defense, porém só com o goku que acontece isso, ele upa a skill de defense super rapido, e o player fica com milhoes de defense em pouco tempo, queria saber como retiro isso. Quando o hoku passa do level 50 ele nao buga mais.
  23. Galera logo logo meu server de wodbo 8.0 esta pronto, e vou coloca-lo online, estou querendo a servercore por grandes indicações, porem nao sei nada sobre linux, minha duvida é : Como compilar e instalar o xampp no linux Como compilar meu servidor para rodar com linux Caso eu queira editar alguns scripts.lua no server é só acessar a pasta e editar? Qual o melhor linux?

Informação Importante

Confirmação de Termo