Ir para conteúdo

MatheusGlad

Cavaleiro
  • Conteúdo

    528
  • Registrado

  • Última visita

  • Days Won

    30

MatheusGlad last won the day on Novembro 30 2015

MatheusGlad had the most liked content!

Sobre MatheusGlad

  • Rank
    <~~> Scripter <~~>
  • Data de Nascimento 25-06-1996

Informações

  • Char no Tibia
    Emekalo Makalo
  • Forma que conheci o xTibia
    Otservs
  • Sou
    Scripter

Últimos Visitantes

17.136 visualizações
  1. ola como fazer o server manda menssagem para os players

  2. Hoje

    Queria saber porque meu nome virou MatheusGlad
  3. mano estou com um server tibia ot 8.00 pra por on nao coloquei ainda pq nao estou conseguindo por uma porta pra so passar conta premium, tentei já um monte de script ai mais sem sucesso cara estou desisperado por favor me ajuda ai obrigado, tem como é pra por uma porta pra so  passar conta premium.

  4. pedido Vocações sumonar quantidades diferente de monstros.

    Ao inves de botar todos os monstros sumonaveis em uma table, melhor fazer if getMonsterInfo(name).summonable then, usa tabela soh pra fazer vocaçoes poderem sumonar monstros que nao sejam sumonaveis. So tem um problema, players soh vao consiguir sumonar esses monstros se tiver a flag "convinceable" no xml do monstro. Então voce teria que retirar a runa que da convince pra nao ter problema ou entao mudar o code dela tambem.
  5. pedido [Pedido] Key Door

    Bem, não era pra ser desse jeito? Voce abre a porta e o actionid some, se voce usar a chave denovo tranca a porta Oo
  6. O certo é Lua não LUA. http://www.lua.org/about.html#name Links: http://lua-users.org/wiki/TutorialDirectory http://www.lua.org/manual/5.1/pt/manual.html
  7. action Reward Chest & Boss Reward

    O que acontece quando voce abre o reward chest em vez do corpo do boss? Ve se crasha ou se da debug. Tenta mudar a function onKill no arquivo rewardloot.lua por: function onKill(creature, target) target = Monster(target) if (target ~= nil) then local mt = MonsterType(target:getName()) if mt:useRewardChest() then local loot = BossLoot:new(target) if loot then local corpse = Item(doCreateItem(MonsterType(target:getName()):getCorpseId(), 1, target:getPosition())) corpse:decay() target:setDropLoot(false) loot:updateDamage() loot:setRewards() loot:addRewards() corpse:setAttribute('aid', 21584) end end end end Se continuar crashando, não posso te ajudar porque eu fiz o sistema para TFS 1.2.
  8. pedido [Pedido] Key Door

    Muda: local unlock = door:unlock(item.actionid) ... ... local lock = door:lock(item.actionid) Por: local unlock = door:unlock(item.itemid) ... ... local lock = door:lock(item.itemid) E bota o itemid dessa chave como actionid na porta e na tabela doors.
  9. function getPlayerReset(cid) local pid = getPlayerGUID(cid) local qr = db.getResult("SELECT `reset` FROM `players` WHERE `id`= ".. pid..";") rss = qr:getDataInt("reset", pid) if not rss or not tonumber(rss) then rss = 0 end return rss end local hours = 1 -- tempo em horas local position = {x = 123, y = 456, z = 7} function onUse(cid, item) if getPlayerReset(cid) >= 10 then if getPlayerStorageValue(cid, 4954)-os.time() <= 0 then doTeleportThing(cid, position) setPlayerStorageValue(cid, 4954, os.time() + hours * 60 * 60) else doPlayerSendCancel(cid, "You need to wait: ".. getPlayerStorageValue(cid, 4954) - os.time() .."s to use this again.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end else doPlayerSendCancel(cid, "You need 10 resets to do this") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end return true end
  10. pedido [Pedido] Key Door

    Door = {} function Door:new(position, keyaid, openid, closedid) return setmetatable({position=position, keyaid=keyaid, openid=openid, closedid=closedid, locked=true, id=closedid}, {__index = Door}) end function Door:isLocked() if self.id == self.closedid then return self.locked end end function Door:setUid(uid) self.uid = uid return true end function Door:unlock(keyaid) if self.uid and keyaid == self.keyaid then self.locked = false self.id = self.openid doTransformItem(self.uid, self.openid) doItemSetAttribute(self.uid, "aid", 0) return true end end function Door:lock(keyaid) if self.uid and keyaid == self.keyaid then self.locked = true self.id = self.closedid doTransformItem(self.uid, self.closedid) doItemSetAttribute(self.uid, "aid", keyaid) return true end end function getDoorByPosition(position, doors) for _, door in ipairs(doors) do if doComparePositions(door.position, position) then return door end end end -- Door:new(posiçao, actionid, idportaabertam idportafechada) local doors = { [1] = Door:new({x=156, y=54, z=7}, 1230, 5100, 5099), [2] = Door:new({x=152, y=54, z=7}, 1231, 5100, 5099), } function onUse(cid, item, fromPosition, itemEx, toPosition) local door = getDoorByPosition(toPosition, doors) if door then if itemEx.itemid == door.openid or itemEx.itemid == door.closedid then door:setUid(itemEx.uid) if item.uid == itemEx.uid then if door:isLocked() then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.") end else if door:isLocked() then local unlock = door:unlock(item.actionid) if not unlock then return doPlayerSendCancel(cid, "The key does not match.") end else local lock = door:lock(item.actionid) if not lock then return doPlayerSendCancel(cid, "The key does not match.") end end end end end return true end Bota o mesmo action id na porta e na chave. Soh edite a tabela doors. Tag: <action actionid="1230-1231" event="script" value="test.lua"/>
  11. action Reward Chest & Boss Reward

    Creditos: Baseado no code do cbrm: https://otland.net/threads/reward-chest-boss-reward-tfs-1-2.233397/ Instruções:: src/const.h: Embaixo de... ITEM_MARKET = 14405, ...Adicione: ITEM_REWARD_BAG = 21518, ITEM_REWARD_CHEST = 21584, REWARD_CHEST_DEPOTID = 99, src/depotchest.h: Embaixo de... explicit DepotChest(uint16_t _type); ...Adicione: uint32_t getDepotId() const { return depotId; } void setDepotId(uint32_t id) { depotId = id; } Embaixo de... uint32_t maxDepotItems; ...Adicione: uint32_t depotId; src/depotchest.cpp: Embaixo de... maxDepotItems = 1500; ...Adicione: depotId = 0; Em cima de... return Container::queryAdd(index, thing, count, flags, actor); ...Adicione: if (actor != nullptr && getDepotId() == REWARD_CHEST_DEPOTID) { return RETURNVALUE_NOTPOSSIBLE; } src/depotlocker.h: Em cima de... //cylinder implementations ...Adicione: void setMaxLockerItems(uint32_t maxitems) { maxSize = maxitems; } src/player.h: Embaixo de... DepotLocker* getDepotLocker(uint32_t depotId); ...Adicione: DepotChest* getRewardBag(uint32_t depotId, bool autoCreate); DepotLocker* getRewardChest(uint16_t itemId); src/player.cpp: Em cima de... void Player::sendCancelMessage(ReturnValue message) const ...Adicione: DepotChest* Player::getRewardBag(uint32_t depotId, bool autoCreate) { auto it = depotChests.find(depotId); if (it != depotChests.end()) { return it->second; } if (!autoCreate) { return nullptr; } DepotChest* bagReward = new DepotChest(ITEM_REWARD_BAG); bagReward->setDepotId(depotId); bagReward->incrementReferenceCounter(); bagReward->setMaxDepotItems(getMaxDepotItems()); depotChests[depotId] = bagReward; return bagReward; } DepotLocker* Player::getRewardChest(uint16_t itemId) { auto it = depotLockerMap.find(REWARD_CHEST_DEPOTID); if (it != depotLockerMap.end()) { it->second->setID(itemId); return it->second; } DepotLocker* rewardChest = new DepotLocker(ITEM_REWARD_CHEST); rewardChest->setID(itemId); rewardChest->setDepotId(REWARD_CHEST_DEPOTID); rewardChest->setMaxLockerItems(1); rewardChest->internalAddThing(getRewardBag(REWARD_CHEST_DEPOTID, true)); depotLockerMap[REWARD_CHEST_DEPOTID] = rewardChest; return rewardChest; } Em player.cpp, container.cpp, inbox.cpp: Mude: if (!item->isPickupable()) { Por: if (item->getID() != 21518 && !item->isPickupable()) { src/actions.cpp: Mude: //depot container if (DepotLocker* depot = container->getDepotLocker()) { DepotLocker* myDepotLocker = player->getDepotLocker(depot->getDepotId()); myDepotLocker->setParent(depot->getParent()->getTile()); openContainer = myDepotLocker; player->setLastDepotId(depot->getDepotId()); } else { openContainer = container; } Por: //reward chest and depot container if (item->getActionId() == ITEM_REWARD_CHEST || item->getID() == ITEM_REWARD_CHEST) { DepotLocker* myRewardChest = player->getRewardChest(item->getID()); myRewardChest->setParent(item->getTile()); openContainer = myRewardChest; player->setLastDepotId(REWARD_CHEST_DEPOTID); } else if (DepotLocker* depot = container->getDepotLocker()) { DepotLocker* myDepotLocker = player->getDepotLocker(depot->getDepotId()); myDepotLocker->setParent(depot->getParent()->getTile()); openContainer = myDepotLocker; player->setLastDepotId(depot->getDepotId()); } else { openContainer = container; } src/game.cpp: Em cima de... if (!item->isPushable() || item->hasAttribute(ITEM_ATTRIBUTE_UNIQUEID)) { ...Adicione: if (item->getID() == ITEM_REWARD_BAG || item->getActionId() == ITEM_REWARD_CHEST) { player->sendCancelMessage(RETURNVALUE_NOTMOVEABLE); return; } src/monsters.h: Embaixo de... int32_t subType; int32_t actionId; std::string text; ...Adicione: bool uniquedrop; Embaixo de... actionId = -1; ...Adicione: uniquedrop = false; Embaixo de... bool hiddenHealth; ...Adicione: bool rewardChest; src/monsters.cpp: Embaixo de... healthMax = 100; ...Adicione: rewardChest = false; Embaixo de... } else if (strcasecmp(attrName, "hidehealth") == 0) { mType->hiddenHealth = attr.as_bool(); ...Adicione: } else if (strcasecmp(attrName, "rewardchest") == 0) { mType->rewardChest = attr.as_bool(); Em cima de... if ((attr = node.attribute("actionId"))) { ...Adicione: if ((attr = node.attribute("uniquedrop"))) { lootBlock.uniquedrop = attr.as_bool(); } src/iologindata.cpp: Embaixo de... //load depot items ...Adicione: player->getRewardChest(ITEM_REWARD_CHEST); Mude: if (pid >= 0 && pid < 100) { DepotChest* depotChest = player->getDepotChest(pid, true); if (depotChest) { depotChest->internalAddThing(item); } Por: if (pid >= 0 && pid < 100) { if (pid == REWARD_CHEST_DEPOTID) { DepotChest* depotChest = player->getRewardBag(pid, true); if (depotChest) { depotChest->internalAddThing(item); } } else { DepotChest* depotChest = player->getDepotChest(pid, true); if (depotChest) { depotChest->internalAddThing(item); } } src/luascript.h: Em cima de... // Combat ...Adicione: // Reward static int luaItemGetNameDescription(lua_State* L); static int luaMonsterTypeUseRewardChest(lua_State* L); src/luascript.cpp: Em cima de... // Party registerClass("Party", "", nullptr); ...Adicione: // Reward registerMethod("MonsterType", "useRewardChest", LuaScriptInterface::luaMonsterTypeUseRewardChest); registerMethod("Item", "getNameDescription", LuaScriptInterface::luaItemGetNameDescription); Em cima de... // Combat int LuaScriptInterface::luaCombatCreate(lua_State* L) ...Adicione: int LuaScriptInterface::luaItemGetNameDescription(lua_State* L) { // item:getNameDescription() const Item* item = getUserdata<const Item>(L, 1); int32_t subType; bool addArticle = true; if (item) { subType = item->getSubType(); const ItemType& it = Item::items[item->getID()]; std::ostringstream s; const std::string& name = (item ? item->getName() : it.name); if (!name.empty()) { if (it.stackable && subType > 1) { if (it.showCount) { s << subType << ' '; } s << (item ? item->getPluralName() : it.getPluralName()); } else { if (addArticle) { const std::string& article = (item ? item->getArticle() : it.article); if (!article.empty()) { s << article << ' '; } } s << name; } } else { s << "an item of type " << it.id; } pushString(L, s.str()); } else { lua_pushnil(L); } return 1; } int LuaScriptInterface::luaMonsterTypeUseRewardChest(lua_State* L) { // monsterType:useRewardChest() MonsterType* monsterType = getUserdata<MonsterType>(L, 1); if (monsterType) { pushBoolean(L, monsterType->rewardChest); } else { lua_pushnil(L); } return 1; } Mude: int LuaScriptInterface::luaMonsterTypeGetLoot(lua_State* L) { // monsterType:getLoot() MonsterType* monsterType = getUserdata<MonsterType>(L, 1); if (!monsterType) { lua_pushnil(L); return 1; } static const std::function<void(const std::vector<LootBlock>&)> parseLoot = [&](const std::vector<LootBlock>& lootList) { lua_createtable(L, lootList.size(), 0); int index = 0; for (const auto& lootBlock : lootList) { lua_createtable(L, 0, 7); setField(L, "itemId", lootBlock.id); setField(L, "chance", lootBlock.chance); setField(L, "subType", lootBlock.subType); setField(L, "maxCount", lootBlock.countmax); setField(L, "actionId", lootBlock.actionId); setField(L, "text", lootBlock.text); parseLoot(lootBlock.childLoot); lua_setfield(L, -2, "childLoot"); lua_rawseti(L, -2, ++index); } }; parseLoot(monsterType->lootItems); return 1; } Por: int LuaScriptInterface::luaMonsterTypeGetLoot(lua_State* L) { // monsterType:getLoot() MonsterType* monsterType = getUserdata<MonsterType>(L, 1); if (!monsterType) { lua_pushnil(L); return 1; } static const std::function<void(const std::vector<LootBlock>&)> parseLoot = [&](const std::vector<LootBlock>& lootList) { lua_createtable(L, lootList.size(), 0); int index = 0; for (const auto& lootBlock : lootList) { lua_createtable(L, 0, 8); setField(L, "itemId", lootBlock.id); setField(L, "chance", lootBlock.chance); setField(L, "subType", lootBlock.subType); setField(L, "maxCount", lootBlock.countmax); setField(L, "actionId", lootBlock.actionId); setField(L, "text", lootBlock.text); pushBoolean(L, lootBlock.uniquedrop); lua_setfield(L, -2, "uniquedrop"); parseLoot(lootBlock.childLoot); lua_setfield(L, -2, "childLoot"); lua_rawseti(L, -2, ++index); } }; parseLoot(monsterType->lootItems); return 1; } Pronto, a parte de C++ acabou agora o resto: Adicione @ data/items/items/xml <item id="21518" article="a" name="reward container"> <attribute key="weight" value="1800" /> <attribute key="containersize" value="100" /> <attribute key="slotType" value="backpack" /> </item> <item id="21584" article="a" name="reward chest"> <attribute key="type" value="depot" /> <attribute key="containerSize" value="1" /> <attribute key="description" value="This chest contains your rewards earned in battles." /> </item> Adicione @ data/creaturescripts/creaturescripts.xml <event type="kill" name="RewardLoot" script="rewardloot.lua"/> Registre @ data/creaturescripts/scripts/login.lua player:registerEvent("RewardLoot") Crie data/creaturescripts/scripts/rewardloot.lua: function sort_descending(t) local tmp = {} for k, v in pairs(t) do table.insert(tmp, {k, v}) end table.sort(tmp, function(a, b) return a[2] > b[2] end) return tmp end function table.find(t, v) for i,x in pairs(t) do if x == v then return true end end end function Player:addItemRewardBag(itemid, count) local rewardbag = self:getDepotChest(99) return rewardbag:addItem(itemid, count) end function MonsterType:getBossReward(chance, unique) local ret = {} local function randomItem(lootBlock, chance) local randvalue = math.random(0, 100000) / (getConfigInfo("rateLoot") * chance) if randvalue < lootBlock.chance then if (ItemType(lootBlock.itemId):isStackable()) then return (randvalue%lootBlock.maxCount) + 1 else return 1 end end end local lootBlockList = self:getLoot() for _, loot in pairs(lootBlockList) do local rd = randomItem(loot, chance) if rd then if loot.uniquedrop then if unique then table.insert(ret, {loot, rd}) end else table.insert(ret, {loot, rd}) end end end return ret end BossLoot = {} BossUids = {} function BossLoot:new(boss) if not table.find(BossUids, boss:getId()) then table.insert(BossUids, boss:getId()) return setmetatable({creature=boss}, {__index = BossLoot}) end end function BossLoot:updateDamage() if self.creature then local tmp = {} local totaldmg = 0 for killer, damage in pairs(self.creature:getDamageMap()) do totaldmg = totaldmg+damage.total tmp[killer] = damage.total end self.players = sort_descending(tmp) self.totaldmg = totaldmg else error("Creature not found.") end end function BossLoot:setRewards() if self.totaldmg and self.creature then if getConfigInfo("rateLoot") > 0 then local mt = MonsterType(self.creature:getName()) for i, playertab in ipairs(self.players) do local loot if i == 1 then loot = mt:getBossReward(playertab[2] / self.totaldmg, true) else loot = mt:getBossReward(playertab[2] / self.totaldmg, false) end table.insert(self.players[i], loot) end end else error("Error") end end function BossLoot:addRewards() if self.players and self.players[1] and self.players[1][3] then for i, playertab in ipairs(self.players) do local player = Player(playertab[1]) if player then local str = "The following items are available in your reward chest: " for i, lootTable in ipairs(playertab[3]) do local item = player:addItemRewardBag(lootTable[1].itemId, math.ceil(lootTable[2])) if item then str = str .. item:getNameDescription() .. ", " end end str = str:sub(1, #str-2) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, str) end end else error("Error") end end function onKill(creature, target) if (Monster(target) ~= nil) then local mt = MonsterType(target:getName()) if mt:useRewardChest() then local loot = BossLoot:new(target) if loot then local corpse = Item(doCreateItem(MonsterType(target:getName()):getCorpseId(), 1, target:getPosition())) corpse:decay() target:setDropLoot(false) loot:updateDamage() loot:setRewards() loot:addRewards() corpse:setAttribute('aid', 21584) end end end end COMO USAR !! Simplesmente adicione essa flag no monstro: <flag rewardchest="1" /> Você tambem pode fazer um drop ser unique, assim somente a pessoa que fez a maior parte do dano vai pegar esse item. <item id="5903" chance="100000" uniquedrop="1" /><!-- ferumbras' hat -->
  12. Evento de Scripting?

    Eu acho que deveriam ser pensados criterios de avaliação, dai voce dava nota pra esses criterios e fazia uma media. Aquele que tivesse a melhor media venceria. No caso "o melhor script" é muito subjetivo, eu posso fazer um script complicado usando coroutine, metamethods, bitwise em um script simples e isso não seria o melhor. Por isso os criterios seriam melhores. E aproveitar o evento tambem pra criar conteudo seria interessante, ao invez de postar o script no post do evento ou mandar private, ter um lugar pra postar eles e depois o topico ser movido para sua determinada area seria bom.
  13. action Ajuda characters.php ( Reset)

    <?PHP $name = stripslashes(ucwords(strtolower(trim($_REQUEST['name'])))); if(empty($name)) { $main_content .= 'Here you can get detailed information about a certain player on '.$config['server']['serverName'].'.<BR> <FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>'; } else { if(check_name($name)) { $player = $ots->createObject('Player'); $player->find($name); if($player->isLoaded()) { $account = $player->getAccount(); $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Information</B></TD></TR>'; if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=20%>Name:</TD><TD><font color="'; $main_content .= ($player->isOnline()) ? 'green' : 'red'; $main_content .= '"><b>'.$player->getName().'</b></font>'; if($player->isDeleted()) $main_content .= '<font color="red"> [DELETED]</font>'; if($player->isNameLocked()) $main_content .= '<font color="red"> [NAMELOCK]</font>'; $main_content .= '</TD></TR>'; if($player->getOldName()) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; if($player->isNameLocked()) $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Proposition:</TD><TD>'.$player->getOldName().'</TD></TR>'; else $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Old name:</TD><TD>'.$player->getOldName().'</TD></TR>'; } // BEGIN Position Showing *** Fixed by jerryb1988 from otfans.net $group = $player->getGroup(); if ($group == 2){$group_name = 'Tutor';} if ($group == 3){$group_name = 'Senior Tutor';} if ($group == 4){$group_name = 'Gamemaster';} if ($group == 5){$group_name = 'Community Manager';} if ($group == 6){$group_name = 'GOD';} if($group != 1) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Position:</TD><TD>'.$group_name.'</TD></TR>'; } // END Position Showing if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Sex:</TD><TD>'; $main_content .= ($player->getSex() == 0) ? 'female' : 'male'; $main_content .= '</TD></TR>'; if($config['site']['show_marriage_info']) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Marital status:</TD><TD>'; $marriage = new OTS_Player(); $marriage->load($player->getMarriage()); if($marriage->isLoaded()) $main_content .= 'married to <a href="?subtopic=characters&name='.urlencode($marriage->getName()).'"><b>'.$marriage->getName().'</b></a></TD></TR>'; else $main_content .= 'single</TD></TR>'; } if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Profession:</TD><TD>'.$vocation_name[$player->getWorld()][$player->getPromotion()][$player->getVocation()].'</TD></TR>'; if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Level:</TD><TD>'.$player->getLevel().'</TD></TR>'; if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>World:</TD><TD>'.$config['site']['worlds'][$player->getWorld()].'</TD></TR>'; if(!empty($towns_list[$player->getWorld()][$player->getTownId()])) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Residence:</TD><TD>'.$towns_list[$player->getWorld()][$player->getTownId()].'</TD></TR>'; if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Balance:</TD><TD>'.$player->getBalance().' Gold Coins.</TD></TR>'; } $rank_of_player = $player->getRank(); if(!empty($rank_of_player)) { { $guild_id = $rank_of_player->getGuild()->getId(); $guild_name = $rank_of_player->getGuild()->getName(); if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Guild Membership:</TD><TD>'.$rank_of_player->getName().' of the <a href="?subtopic=guilds&action=show&guild='.$guild_id.'">'.$guild_name.'</a></TD></TR>'; } } if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $lastlogin = $player->getLastLogin(); if(empty($lastlogin)) $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>Never logged in.</TD></TR>'; else $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>'.date("j F Y, g:i a", $lastlogin).'</TD></TR>'; if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; if($config['site']['show_creationdate'] && $player->getCreated()) { $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Created:</TD><TD>'.date("j F Y, g:i a", $player->getCreated()).'</TD></TR>'; } /*Vip Status*/ if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Vip Status:</TD><TD>'; $main_content .= ($account->getPlayerVipTime()) ? '<b><font color="green">Vip Account</font></b>' : '<b><font color="red">Not Vip Account</font></b>'; if($config['site']['show_vip_status']) { $id = $player->getCustomField("id"); if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=10%>Vip Status:</TD>'; $vip = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$config['site']['show_vip_storage'].';')->fetch(); if($vip == false) { $main_content .= '<TD><span class="red"><B>NOT VIP</B></TD></TR>'; } else { $main_content .= '<TD><span class="green"><B>VIP</B></TD></TR>'; } $comment = $player->getComment(); $newlines = array("\r\n", "\n", "\r"); $comment_with_lines = str_replace($newlines, '<br />', $comment, $count); if($count < 50) $comment = $comment_with_lines; if(!empty($comment)) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>'; } } //Outfit shower by Pening edited by loleslav if($config['site']['show_outfit']) { $id = $player->getCustomField("id"); $main_content .= '<TD BGCOLOR="'.$config['site']['darkborder'].'">Outfit:'; $listaddon = array('128','129','130','131','132','133','134','135','136','137','138','139','140','141','142','143','144','145','146','147','148','149','150','151','152','153','154','155','158','159','251','252','268','269','270','273','278','279','288','289','302','324','325'); $lookadd = array('0','1','2','3'); foreach ($listaddon as $pid => $name) foreach ($lookadd as $addo => $name) { $addon1 = $SQL->query('SELECT * FROM players WHERE id = '.$id.' AND looktype = '.$listaddon[$pid].' AND lookaddons = '.$lookadd[$addo].';')->fetch(); if($addon1[looktype] == true ) { $finaddon = $addon1[looktype] + $addon1[lookaddons] * 300; $main_content .= '<TD with=50% style="background-color: '.$config['site']['darkborder'].'"><center><img src="images/addons/'.$finaddon.'.gif"/></center></TD></TD>'; } } } $main_content .= '</td>'; //end Outfit shower by Pening edited by loleslav if($config['site']['show_signature']) { // Signature by makr0mango. function randomSignature( $folder ) { $files = scandir ( "./$folder/" ); $signature = array(); foreach ( $files as $file ): if ( substr ( strtolower ( $file ) , -4 ) == ".png" ) $signature[] = $file; endforeach; return rand(0,count($signature)-1); } $random = randomSignature("signatures"); $main_content .= '<br><tr></tr><tr></tr><tr></tr><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Signature</B></TD></TR>'; $main_content .= "<TR BGCOLOR=".$config['site']['darkborder']."><TD WIDTH=20%>Forum Link:</TD><TD><input type='text' size='75' onclick='this.select();' value='[url=\"http://" . $_SERVER['HTTP_HOST'] . "\"][IMG=http://" . $_SERVER['HTTP_HOST'] . "/signature.php?character=" .$player->getName(). "ℑ=" . $random . "][/url]' /></TD></TR>"; $main_content .= "<TR BGCOLOR=".$config['site']['lightborder']."><TD WIDTH=20%>Direct Link:</TD><TD><input type='text' size='75' onclick='this.select();' value='http://" . $_SERVER['HTTP_HOST'] . "/signature.php?character=" .$player->getName(). "ℑ=" . $random . "' /></TD></TR>"; $main_content .= "<TR BGCOLOR=".$config['site']['darkborder']."><TD COLSPAN='2' style='text-align: center;'><img src='signature.php?character=" .$player->getName(). "ℑ=" . $random . "' /></TD></TR>"; $main_content .= '</TD></TR></TABLE>'; // Signature by makr0mango. } //modified status scripts by ballack13 $main_content .= '<table width=100%><tr>'; //equipment shower by ballack13 $id = $player->getCustomField("id"); $number_of_items = 1; $main_content .= '<td align=center><table with=100% style="border: solid 1px #888888;" CELLSPACING="1"><TR>'; $list = array('2','1','3','6','4','5','9','7','10','8'); foreach ($list as $pid => $name) { $top = $SQL->query('SELECT * FROM player_items WHERE player_id = '.$id.' AND pid = '.$list[$pid].';')->fetch(); if($top[itemtype] == false) { if($list[$pid] == '8') { $main_content .= '<td style="background-color: '.$config['site']['darkborder'].'; text-align: center;">Soul:<br/>'.$player->getSoul().'</td>'; } if(is_int($number_of_items / 3)){ $main_content .= '<TD style="background-color: '.$config['site']['darkborder'].'; text-align: center;"><img src="images/items/'.$list[$pid].'.gif"/></TD></tr><tr>'; } else { $main_content .= '<TD style="background-color: '.$config['site']['darkborder'].'; text-align: center;"><img src="images/items/'.$list[$pid].'.gif"/></TD>'; } $number_of_items++; } else { if($list[$pid] == '8') { $main_content .= '<td style="background-color: '.$config['site']['darkborder'].'; text-align: center;">Soul:<br/>'.$player->getSoul().'</td>'; } if(is_int($number_of_items / 3)) $main_content .= '<TD style="background-color: '.$config['site']['darkborder'].'; text-align: center;"><img src="images/items/'.$top[itemtype].'.gif" width="45"/></TD></tr><tr>'; else $main_content .= '<TD style="background-color: '.$config['site']['darkborder'].'; text-align: center;"><img src="images/items/'.$top[itemtype].'.gif" width="45"/></TD>'; $number_of_items++; } if($list[$pid] == '8') { $main_content .= '<td style="background-color: '.$config['site']['darkborder'].'; text-align: center;">Cap:<br/>'.$player->getCap().'</td>'; } } $main_content .= '</tr></TABLE></td>'; //Hp/Mana/Exp Status by ballack13 $hp = ($player->getHealth() / $player->getHealthMax() * 100); $main_content .= '<td align=center ><table width=100%><tr><td align=center><table CELLSPACING="1" CELLPADDING="4"><tr><td BGCOLOR="#D4C0A1" align="left" width="20%"><b>Player Health:</b></td> <td BGCOLOR="#D4C0A1" align="left">'.$player->getHealth().'/'.$player->getHealthMax().'<div style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: red; width: '.$hp.'%; height: 3px;"></td></tr>'; if ($player->getManaMax() > 0) { $mana = ($player->getMana() / $player->getManaMax() * 100); $main_content .= '<tr><td BGCOLOR="#F1E0C6" align="left"><b>Player Mana:</b></td><td BGCOLOR="#F1E0C6" align="left">'.$player->getMana().'/'.$player->getManaMax().'<div style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: blue; width: '.$mana.'%; height: 3px;"></td>'; } else { $main_content .= '<tr><td BGCOLOR="#F1E0C6" align="left"><b>Player Mana:</b></td><td BGCOLOR="#F1E0C6" align="left">0/0<div style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: blue; width: 100%; height: 3px;"></td>'; } $main_content .= '</tr></table><tr>'; $next = ($player->getLevel() + 1); $id = $player->getCustomField("id"); $resets = $SQL->query('SELECT `reset` FROM `players` WHERE `id`= ' . $id . ';')->fetch(); $exp = ((50 / 3) * ($player->getLevel() * $player->getLevel() * $player->getLevel()) - (100 * ($player->getLevel() * $player->getLevel())) + ((850/3) * $player->getLevel()) - 200); $expnext = ((50 / 3) * ($next * $next * $next) - (100 * ($next * $next)) + ((850/3) * $next) - 200 - $player->getExperience()); $expresult = ($expnext / (($expnext + $player->getExperience()) - $exp) * 100); $main_content .= '<tr><table CELLSPACING="1" CELLPADDING="4"><tr><td BGCOLOR="'.$config['site']['lightborder'].'" align="left" width="20%"><b>Player Level:</b></td><td BGCOLOR="'.$config['site']['lightborder'].'" align="left">'.$player->getLevel().'</td></tr><tr><td BGCOLOR="'.$config['site']['lightborder'].'" align="left" width="20%"><b>Resets:</b></td><td BGCOLOR="'.$config['site']['lightborder'].'" align="left">' . $resets[reset] . '</td></tr> <tr><td BGCOLOR="'.$config['site']['darkborder'].'" align="left"><b>Player Experience:</b></td><td BGCOLOR="'.$config['site']['darkborder'].'" align="left">'.$player->getExperience().' EXP.</td></tr> <tr><td BGCOLOR="'.$config['site']['lightborder'].'" align="left"><b>To Next Level:</b></td><td BGCOLOR="'.$config['site']['lightborder'].'" align="left">You need <b>'.$exp.' EXP</b> to Level <b>'.$next.'</b>.<div title="99.320604545 %" style="width: 100%; height: 3px; border: 1px solid #000;"><div style="background: red; width: '.$expresult.'%; height: 3px;"></td></tr></table></td></tr></table></tr></TABLE></td>'; if($config['site']['show_skills_info']) { //Skills Pics v2. Table borders optimized by Absolute Mango $main_content .= '<br/><table cellspacing="0" cellpadding="0" border="0" width="200" align="center"><caption><strong>Skills</strong></caption><tbody><tr> <td align="center"><a href="?subtopic=highscores&list=experience"><img src="images/skills/level.png" style="border: none;"/></a></td> <td align="center"><a href="?subtopic=highscores&list=magic"><img src="images/skills/ml.png" style="border: none;"/></a></td> <td align="center"><a href="?subtopic=highscores&list=fist"><img src="images/skills/fist.png" style="border: none;"/></a></td> <td align="center"><a href="?subtopic=highscores&list=club"><img src="images/skills/club.png" style="border: none;"/></a></td> <td align="center"><a href="?subtopic=highscores&list=sword"><img src="images/skills/sword.png" style="border: none;"/></a></td> <td align="center"><a href="?subtopic=highscores&list=axe"><img src="images/skills/axe.png" style="border: none;"/></a></td> <td align="center"><a href="?subtopic=highscores&list=distance"><img src="images/skills/dist.png" style="border: none;"/></a></td> <td align="center"><a href="?subtopic=highscores&list=shield"><img src="images/skills/def.png" style="border: none;"/></a></td> <td align="center"><a href="?subtopic=highscores&list=fishing"><img src="images/skills/fish.png" style="border: none;"/></a></td> </tr></tbody></table> <table cellspacing="0" cellpadding="0" border="1" width="360" align="center"><tbody><tr><tr bgcolor="'.$config['site']['darkborder'].'"> <td align="center" width="38"><strong>Level</strong></td> <td align="center" width="38"><strong>ML</strong></td> <td align="center" width="42"><strong>Fist</strong></td> <td align="center" width="40"><strong>Club</strong></td> <td align="center" width="38"><strong>Swrd</strong></td> <td align="center" width="38"><strong>Axe</strong></td> <td align="center" width="38"><strong>Dist</strong></td> <td align="center" width="38"><strong>Shield</strong></td> <td align="center" width="38"><strong>Fish</strong></td></font> </tr> <tr bgcolor="'.$config['site']['lightborder'].'"> <td align="center" width="38">'.$player->getLevel().'</td> <td align="center" width="38">'.$player->getMagLevel().'</td> <td align="center" width="38">'.$player->getSkill(0).'</td> <td align="center" width="38">'.$player->getSkill(1).'</td> <td align="center" width="38">'.$player->getSkill(2).'</td> <td align="center" width="38">'.$player->getSkill(3).'</td> <td align="center" width="38">'.$player->getSkill(4).'</td> <td align="center" width="38">'.$player->getSkill(5).'</td> <td align="center" width="38">'.$player->getSkill(6).'</td> </tr></tbody></table><div table align="center"> <br /> </div>'; //skill script end } //quest status by ballack13 $id = $player->getCustomField("id"); $number_of_quests = 0; $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD align="left" COLSPAN=2 CLASS=white><B>Quests</B></TD></TD align="right"></TD></TR>'; $quests = $config['site']['quests']; foreach ($quests as $storage => $name) { if(is_int($number_of_quests / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder']; $number_of_quests++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=95%>'.$storage.'</TD>'; $quest = $SQL->query('SELECT * FROM player_storage WHERE player_id = '.$id.' AND `key` = '.$quests[$storage].';')->fetch(); if($quest == false) { $main_content .= '<TD><img src="images/false.png"/></TD></TR>'; } else { $main_content .= '<TD><img src="images/true.png"/></TD></TR>'; } } $main_content .= '</TABLE></td></tr></table><br />'; $deads = 0; //deaths list $player_deaths = $SQL->query('SELECT `id`, `date`, `level` FROM `player_deaths` WHERE `player_id` = '.$player->getId().' ORDER BY `date` DESC LIMIT 0,10;'); foreach($player_deaths as $death) { if(is_int($number_of_rows / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder']; $number_of_rows++; $deads++; $dead_add_content .= "<tr bgcolor=\"".$bgcolor."\"> <td width=\"20%\" align=\"center\">".date("j M Y, H:i", $death['date'])."</td> <td>"; $killers = $SQL->query("SELECT environment_killers.name AS monster_name, players.name AS player_name, players.deleted AS player_exists FROM killers LEFT JOIN environment_killers ON killers.id = environment_killers.kill_id LEFT JOIN player_killers ON killers.id = player_killers.kill_id LEFT JOIN players ON players.id = player_killers.player_id WHERE killers.death_id = ".$SQL->quote($death['id'])." ORDER BY killers.final_hit DESC, killers.id ASC")->fetchAll(); $i = 0; $count = count($killers); foreach($killers as $killer) { $i++; if(in_array($i, array(1, $count))) $killer['monster_name'] = str_replace(array("an ", "a "), array("", ""), $killer['monster_name']); if($killer['player_name'] != "") { if($i == 1) $dead_add_content .= "Killed at level <b>".$death['level']."</b> by "; else if($i == $count) $dead_add_content .= " and by "; else $dead_add_content .= ", "; if($killer['monster_name'] != "") $dead_add_content .= $killer['monster_name']." summoned by "; if($killer['player_exists'] == 0) $dead_add_content .= "<a href=\"index.php?subtopic=characters&name=".urlencode($killer['player_name'])."\">"; $dead_add_content .= $killer['player_name']; if($killer['player_exists'] == 0) $dead_add_content .= "</a>"; } else { if($i == 1) $dead_add_content .= "Died at level <b>".$death['level']."</b> by "; else if($i == $count) $dead_add_content .= " and by "; else $dead_add_content .= ", "; $dead_add_content .= $killer['monster_name']; } if($i == $count) $dead_add_content .= "."; } $dead_add_content .= ".</td></tr>"; } if($deads > 0) $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Deaths</B></TD></TR>' . $dead_add_content . '</TABLE><br />'; //end if(!$player->getHideChar()) { $main_content .= '<TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Account Information</B></TD></TR>'; if($account->getRLName()) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Real name:</TD><TD>'.$account->getRLName().'</TD></TR>'; } if($account->getLocation()) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=20%>Location:</TD><TD>'.$account->getLocation().'</TD></TR>'; } if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; if($account->getLastLogin()) $main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Last login:</TD><TD>'.date("j F Y, g:i a", $account->getLastLogin()).'</TD></TR>'; else $main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Last login:</TD><TD>Never logged in.</TD></TR>'; if($account->getCreated()) { if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Created:</TD><TD>'.date("j F Y, g:i a", $account->getCreated()).'</TD></TR>'; } if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Account Status:</TD><TD>'; $main_content .= ($account->isPremium()) ? '<b><font color="green">Premium Account</font></b>' : '<b><font color="green">Gratis Premium Account</font></b>'; if($account->isBanned()) if($account->getBanTime() > 0) $main_content .= '<font color="red"> [Banished until '.date("j F Y, G:i", $account->getBanTime()).']</font>'; else $main_content .= '<font color="red"> [Banished FOREVER]</font>'; $main_content .= '</TD></TR></TABLE>'; $main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=5 CLASS=white><B>Characters</B></TD></TR> <TR BGCOLOR='.$config['site']['darkborder'].'><TD><B>Name</B></TD><TD><B>World</B></TD><TD><B>Level</B></TD><TD><b>Status</b></TD><TD><B> </B></TD></TR>'; $account_players = $account->getPlayersList(); $account_players->orderBy('name'); $player_number = 0; foreach($account_players as $player_list) { if(!$player_list->getHideChar()) { $player_number++; if(is_int($player_number / 2)) $bgcolor = $config['site']['darkborder']; else $bgcolor = $config['site']['lightborder']; if(!$player_list->isOnline()) $player_list_status = '<font color="red">Offline</font>'; else $player_list_status = '<font color="green">Online</font>'; $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=52%><NOBR>'.$player_number.'. '.$player_list->getName(); $main_content .= ($player_list->isDeleted()) ? '<font color="red"> [DELETED]</font>' : ''; $main_content .= '</NOBR></TD><TD WIDTH=15%>'.$config['site']['worlds'][$player_list->getWorld()].'</TD><TD WIDTH=25%>'.$player_list->getLevel().' '.$vocation_name[$player_list->getWorld()][$player_list->getPromotion()][$player_list->getVocation()].'</TD><TD WIDTH="8%"><b>'.$player_list_status.'</b></TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=characters" METHOD=post><TR><TD><INPUT TYPE=hidden NAME=name VALUE="'.$player_list->getName().'"><INPUT TYPE=image NAME="View '.$player_list->getName().'" ALT="View '.$player_list->getName().'" SRC="'.$layout_name.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></TD></TR>'; } } $main_content .= '</TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>'; } $main_content .= '<BR><BR><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>'; $main_content .= '</TABLE>'; } else $search_errors[] = 'Character <b>'.$name.'</b> does not exist.'; } else $search_errors[] = 'This name contains invalid letters. Please use only A-Z, a-z and space.'; if(!empty($search_errors)) { $main_content .= '<div class="SmallBox" > <div class="MessageContainer" > <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="ErrorMessage" > <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div> <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>'; foreach($search_errors as $search_error) $main_content .= '<li>'.$search_error; $main_content .= '</div> <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div> <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div> </div></div><br/>'; $main_content .= '<BR><FORM ACTION="?subtopic=characters" METHOD=post><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>'; } } ?> Tenta isso. Não garanto nada Deve aparecer em baixo do level do player se funcionar
  14. action [ACTION] Summon Scroll

    Muito bom o code, na parte de tirar os espaços eu nao usaria o %a, pq nomes de monstros não consistem exclusivamente de letras (os normais sim) e poderia bugar se eu tivesse um monstro com o nome "Mkalo'Boss" e usaria table.concat Eu faria assim: local name = " Mkalo's baby " function string.exp(e, sep) local result = {} e:gsub("[^".. sep .."]+", function(s) table.insert(result, s:match("^%s*(.-)%s*$")) end) return result end name = table.concat(name:exp("%s"), " ")
  15. action Bug Cassino

    --[ Script written and published by Orzeleagle/Collocorpus ]-- function addPlayerItem(itemid, amount, cid) if amount%100 > 0 then local iuid = doCreateItemEx(itemid, amount%100) doPlayerAddItemEx(cid, iuid) end for i = 1, math.floor(amount/100) do iuid = doCreateItemEx(itemid, 100) doPlayerAddItemEx(cid, iuid) end return true end function onUse(cid, item, fromPosition, itemEx, toPosition) local config = { chance = math.random(1, 100), --losowanie win_chance = 80, --chance to win a percentage of multi = 3, --how many times you win more (eg 2 or 1cc bet, win and get 2cc) items = {2160, 2152}, --id items whom you can play min_count = 1, --Minimum Number of items (1 = least 1cc) max_count = 100 --maximum number of objects (10 = maximum 10cc) } local positions = { [7010] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7011] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7012] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7013] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7014] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7015] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7016] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7017] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7018] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255}, [7019] = {x=fromPosition.x-1, y=(fromPosition.y), z=fromPosition.z, stackpos=255} } local itemplay = getThingfromPos(positions[item.actionid]) local storage, exh = 56500, 5 --storage id, time exh if (item.itemid == 1945) then doTransformItem(item.uid, 1946) if (getPlayerStorageValue(cid, storage)-os.time(t) < 1) then doPlayerSetStorageValue(cid, storage, os.time(t)+exh) if (isInArray(config.items, itemplay.itemid)) then if (itemplay.type >= config.min_count) and (itemplay.type <= config.max_count) then if (config.chance <= config.win_chance) then doRemoveItem(itemplay.uid, itemplay.type) positions[item.actionid].stackpos = nil addPlayerItem(itemplay.itemid, (itemplay.type*config.multi), cid) doSendMagicEffect(positions[item.actionid], 31) doSendMagicEffect(getCreaturePosition(cid), 27) doPlayerSendCancel(cid, "Parabéns, você acaba de ganhar em nosso cassino!") doSendAnimatedText(getCreaturePosition(cid), "~!Winner!~", TEXTCOLOR_YELLOW) return true else doRemoveItem(itemplay.uid, itemplay.type) doSendMagicEffect(positions[item.actionid], 31) doSendMagicEffect(getCreaturePosition(cid), 13) doPlayerSendCancel(cid, "É o seu dia de azar! você perdeu.") doSendAnimatedText(getCreaturePosition(cid), "~!Loser!~", TEXTCOLOR_LIGHTBLUE) return true end else doPlayerSendCancel(cid, "You can play only with amount from ".. config.min_count .." to ".. config.max_count ..".") doSendMagicEffect(fromPosition, 2) return true end else doPlayerSendCancel(cid, "You cannot play with this item.") doSendMagicEffect(fromPosition, 2) return true end else doPlayerSendCancel(cid, "You must wait another ".. getPlayerStorageValue(cid, storage)-os.time(t) .." seconds.") doSendMagicEffect(fromPosition, 2) return true end else doTransformItem(item.uid, 1945) doSendMagicEffect(fromPosition, 2) return true end end
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×