Tudo que Danyel Varejao postou
-
(Resolvido)ERRO GRAVISSIMO
Substitua para essa: Cylinder* Player::__queryDestination(int32_t& index, const Thing* thing, Item** destItem, uint32_t& flags) { if(!index /*drop to capacity window*/ || index == INDEX_WHEREEVER) { *destItem = NULL; const Item* item = thing->getItem(); if(!item) return this; std::list<std::pair<Container*, int32_t> > containers; std::list<std::pair<Cylinder*, int32_t> > freeSlots; bool autoStack = !((flags & FLAG_IGNOREAUTOSTACK) == FLAG_IGNOREAUTOSTACK); for(int32_t i = SLOT_FIRST; i < SLOT_LAST; ++i) { if(Item* invItem = inventory[i]) { if(invItem == item || invItem == tradeItem) continue; if(autoStack && item->isStackable() && __queryAdd(i, item, item->getItemCount(), 0) == RET_NOERROR && invItem->getID() == item->getID() && invItem->getItemCount() < 100) { *destItem = invItem; index = i; return this; } if(Container* container = invItem->getContainer()) { if(!autoStack && container->__queryAdd(INDEX_WHEREEVER, item, item->getItemCount(), flags) == RET_NOERROR) { index = INDEX_WHEREEVER; return container; } containers.push_back(std::make_pair(container, 0)); } } else if(!autoStack) { if(__queryAdd(i, item, item->getItemCount(), 0) == RET_NOERROR) { index = i; return this; } } else freeSlots.push_back(std::make_pair(this, i)); } while(!containers.empty()) { Container* tmpContainer = containers.front().first; int32_t level = containers.front().second; containers.pop_front(); if(!tmpContainer) continue; for(uint32_t n = 0; n < tmpContainer->capacity(); ++n) { if(Item* tmpItem = tmpContainer->getItem(n)) { if(tmpItem == item || tmpItem == tradeItem) continue; if(autoStack && item->isStackable() && tmpContainer->__queryAdd(n, item, item->getItemCount(), 0) == RET_NOERROR && tmpItem->getID() == item->getID() && tmpItem->getItemCount() < 100) { index = n; *destItem = tmpItem; return tmpContainer; } if(Container* container = tmpItem->getContainer()) { if(!autoStack && container->__queryAdd(INDEX_WHEREEVER, item, item->getItemCount(), flags) == RET_NOERROR) { index = INDEX_WHEREEVER; return container; } containers.push_back(std::make_pair(container, level + 1)); } } else { if(!autoStack) { if(tmpContainer->__queryAdd(n, item, item->getItemCount(), 0) == RET_NOERROR) { index = n; return tmpContainer; } } else freeSlots.push_back(std::make_pair(tmpContainer, n)); break; // one slot to check is definitely enough. } } } if(autoStack) { while(!freeSlots.empty()) { Cylinder* tmpCylinder = freeSlots.front().first; int32_t i = freeSlots.front().second; freeSlots.pop_front(); if(!tmpCylinder) continue; if(tmpCylinder->__queryAdd(i, item, item->getItemCount(), flags) == RET_NOERROR) { index = i; return tmpCylinder; } } } return this; } Thing* destThing = __getThing(index); if(destThing) *destItem = destThing->getItem(); if(Cylinder* subCylinder = dynamic_cast<Cylinder*>(destThing)) { index = INDEX_WHEREEVER; *destItem = NULL; return subCylinder; } return this; } Seu problema era uma configuração no config.lua de máximo de backpacks que iriam achar. Foi removido as linhas: int32_t deepness = g_config.getNumber(ConfigManager::PLAYER_DEEPNESS); if(deepness < 0 || level < deepness) containers.push_back(std::make_pair(container, level + 1));
-
(Resolvido)ERRO GRAVISSIMO
Posta a função __queryDestination do player.cpp aqui.
-
Addon Doll
- (Resolvido)[Erro] função creature:moveTo
@Rayo o erro apresentado é que você não possui a função creature:moveTo(pos) em sua source, verifique se seguiu o tutorial corretamente e compilou sua source.- Ajuda com script da annihilator
local room = { -- room with demons fromX = 33229, fromY = 31697, fromZ = 14, toX = 33224, toY = 31697, toZ = 14 } local monster_pos = { [1] = {pos = {33224, 31695, 14}, monster = "Demon"}, [2] = {pos = {33226, 31695, 14}, monster = "Demon"}, [3] = {pos = {33228, 31697, 14}, monster = "Demon"}, [4] = {pos = {33229, 31697, 14}, monster = "Demon"}, [5] = {pos = {33227, 31699, 14}, monster = "Demon"}, [6] = {pos = {33225, 31699, 14}, monster = "Demon"} } local monster_area = { area = { topLeftPos = {x = 33224, y = 31695, z = 14}, bottomRightPos = {x = 33250, y = 31750, z = 12}, }, monsters = { {name = "Fire Elemental", count = 5}, {name = "Hellfire Fighter", count = 2}, } } local players_pos = { {x = 33224, y =31671, z = 13, stackpos = 253}, {x = 33223, y =31671, z = 13, stackpos = 253}, {x = 33222, y =31671, z = 13, stackpos = 253}, {x = 33221, y =31671, z = 13, stackpos = 253} } local new_player_pos = { {x = 33227, y = 31697, z = 14}, {x = 33226, y = 31697, z = 14}, {x = 33225, y = 31697, z = 14}, {x = 33224, y = 31697, z = 14} } local playersOnly = "no" local questLevel = 101 function onUse(cid, item, fromPosition, itemEx, toPosition) local all_ready, monsters, player, level = 0, 0, {}, 0 if item.itemid == 1945 then for i = 1, #players_pos do table.insert(player, 0) end for i = 1, #players_pos do player = getThingfromPos(players_pos) if player.itemid > 0 then if string.lower(playersOnly) == "yes" then if isPlayer(player.uid) == TRUE then all_ready = all_ready+1 else monsters = monsters+1 end else all_ready = all_ready+1 end end end if all_ready == #players_pos then for i = 1, #players_pos do player = getThingfromPos(players_pos) if isPlayer(player.uid) == TRUE then if getPlayerLevel(player.uid) >= questLevel then level = level+1 end else level = level+1 end end if level == #players_pos then if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then for _, area in pairs(monster_pos) do doSummonCreature(area.monster,{x=area.pos[1],y=area.pos[2],z=area.pos[3]}) end for i = 1, #monster_area.monsters do local PosX = math.random(monster_area.area.topLeftPos.x, monster_area.area.bottomRightPos.x) local PosY = math.random(monster_area.area.topLeftPos.y, monster_area.area.bottomRightPos.y) local PosZ = monster_area.area.topLeftPos.z local position = {x = PosX, y = PosY, z = PosZ} for k = 1, monster_area.monsters[i].count do doSummonCreature(monster_area.monsters[i].name, position, false, true) end end for i = 1, #players_pos do doSendMagicEffect(players_pos, CONST_ME_POFF) doTeleportThing(player.uid, new_player_pos, FALSE) doSendMagicEffect(new_player_pos, CONST_ME_ENERGYAREA) doTransformItem(item.uid,1946) end else doPlayerSendTextMessage(cid,19,"Only players can do this quest.") end else doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.") end else doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.") end elseif item.itemid == 1946 then local player_room = 0 for x = room.fromX, room.toX do for y = room.fromY, room.toY do for z = room.fromZ, room.toZ do local pos = {x=x, y=y, z=z,stackpos = 253} local thing = getThingfromPos(pos) if thing.itemid > 0 then if isPlayer(thing.uid) == TRUE then player_room = player_room+1 end end end end end if player_room >= 1 then doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.") elseif player_room == 0 then for x = room.fromX, room.toX do for y = room.fromY, room.toY do for z = room.fromZ, room.toZ do local pos = {x=x, y=y, z=z,stackpos = 253} local thing = getThingfromPos(pos) if thing.itemid > 0 then doRemoveCreature(thing.uid) end end end end doTransformItem(item.uid,1945) end end return TRUE end- (Resolvido)[Creaturescript] Como travar um player se tiver tal storage?
Ok. Marque como melhor resposta se possível, obrigado!- (Resolvido)[Creaturescript] Como travar um player se tiver tal storage?
@poko360 me fala como você quer, com os magic effect etc, que da pra fazer tudo na source mesmo, além de mais otimizado seria a melhor forma pra isso sem consumir muito processamento.- (Resolvido)[Creaturescript] Como travar um player se tiver tal storage?
Em game.cpp procure por: bool Game::playerMove(uint32_t playerId, Direction dir) Dentro dessa função terá isso daqui: if(player->getNoMove()) { player->sendCancelWalk(); return false; } Logo abaixo adicione isso: std::string value; player->getStorage("6000", value); int32_t playerStorage = atoi(value.c_str()); if(playerStorage > 0) { player->sendCancelWalk(); return false; } Feche, salve, compile novamente e teste.- Auto Loot Perfect
Troca a lib para esta e veja se corrige. --[[ Auto Loot System by Danyel Varejão ]] AutoLoot = { Min_Level = 100, -- Level minimo pra utilizar o auto loot. Max_Slots = 5, -- Máximo de slots permitidos. Boost_Actived = true, -- Nao mexa daqui pra baixo caso nao entenda -- Storage_Boost = 45000, Storage_On_Items = 45001, Storage_On_Gold = 45002, Storages = { Count_Gold = 45003, Count_Items = 45004, Count_Table = 45005, Slots = {45006, 45007, 45008, 45009, 45010} -- Storage pra cada slot. } } AutoLoot_Boost = { -- [ID do item] = Valor, [2406] = 36, [2537] = 4800, [2377] = 480, [2663] = 600, [2472] = 240000, [2398] = 36, [2475] = 7200, [2519] = 6000, [2497] = 10800, [2523] = 180000, [2494] = 108000, [2400] = 144000, [2491] = 6000, [2421] = 108000, [2646] = 240000, [2477] = 7200, [2413] = 84, [2656] = 18000, [2498] = 48000, [2647] = 600, [2534] = 30000, [7402] = 24000, [2466] = 36000, [2465] = 240, [2408] = 120000, [2518] = 1800, [2500] = 3000, [2376] = 30, [2470] = 96000, [2388] = 24, [2645] = 48000, [2434] = 2400, [2463] = 480, [2536] = 9600, [2387] = 240, [2396] = 4800, [2381] = 240, [2528] = 4800, [2409] = 1800, [2414] = 12000, [2427] = 9000, [2407] = 7200, [2458] = 42, [2383] = 960, [2392] = 3600, [2488] = 18000, [2525] = 120, [2423] = 240, [2462] = 4800, [2520] = 48000, [2390] = 180000, [2417] = 72, [2436] = 1200, [5741] = 42000, [2378] = 120, [2487] = 24000, [2476] = 6000, [8891] = 36000, [2459] = 36, [2195] = 48000, [2391] = 7200, [2464] = 120, [8889] = 72000, [2432] = 12000, [2431] = 108000, [2492] = 72000, [2515] = 240, [2430] = 2400, [2393] = 12000, [7419] = 36000, [2522] = 120000, [2514] = 180000 } function AutoLoot.CountTable(table) local Count = 0 if type(table) == "table" then for index in pairs(table) do Count = Count + 1 end return Count end return false end function AutoLoot.getContainerItemsInfo(ContainerUID) local Table = {} if ContainerUID and ContainerUID > 0 then local Index = 0 for i = 0, getContainerSize(ContainerUID) - 1 do local item = getContainerItem(ContainerUID, i) Index = Index + 1 Table[Index] = {UID = item.uid, ItemID = item.itemid, Count = item.type} end return Table end return false end function AutoLoot.String(String) local Table = {} local x, old, last = 0, 0, 0 local first, second, final = 0, 0, 0 if type(String) ~= "string" then return Table end for i = 2, #String - 1 do if string.byte(String:sub(i,i)) == string.byte(':') then x, second, last = x + 1, i - 1, i + 2 for t = last, #String - 1 do if string.byte(String:sub(t,t)) == string.byte(',') then first = x == 1 and 2 or old old, final = t + 2, t - 1 local Index = String:sub(first, second) local Var = String:sub(last, final) Table[tonumber(Index) or tostring(Index)] = tonumber(Var) or tostring(Var) break end end end end return Table end function AutoLoot.TranslateString(Table) local String = "" if type(Table) ~= "table" then return String end for i, last in pairs(Table) do String = String..i..": ".. last ..", " end String = "a"..String.."a" return tostring(String) end function AutoLoot.getPlayerStorageZero(cid, key) return getPlayerStorageValue(cid, key) > 0 and getPlayerStorageValue(cid, key) or 0 end function AutoLoot.getStorageZero(key) return getGlobalStorageValue(key) > 0 and getGlobalStorageValue(key) or 0 end function AutoLoot.setPlayerTableStorage(cid, key, value) return doPlayerSetStorageValue(cid, key, AutoLoot.TranslateString(value)) end function AutoLoot.setGlobalTableStorage(key, value) return setGlobalStorageValue(key, AutoLoot.TranslateString(value)) end function AutoLoot.getPlayerTableStorage(cid, key) return AutoLoot.String(getPlayerStorageValue(cid, key)) end function AutoLoot.getGlobalTableStorage(key) return AutoLoot.String(getGlobalStorageValue(key)) end function AutoLoot.getPlayerList(cid) local Table = {} for i = 1, #AutoLoot.Storages.Slots do if getPlayerStorageValue(cid, AutoLoot.Storages.Slots[i]) ~= -1 then table.insert(Table, getPlayerStorageValue(cid, AutoLoot.Storages.Slots[i])) end end return Table end function AutoLoot.ExistItemByName(name) local Items = io.open("data/items/items.xml", "r"):read("*all") local GetITEM = Items:match('name="' .. name ..'"') if GetITEM == nil or GetITEM == "" then return false end return true end function AutoLoot.addToList(cid, name) local ItemID = getItemIdByName(name) if AutoLoot.getPlayerList(cid) and isInArray(AutoLoot.getPlayerList(cid), ItemID) then return false end for i = 1, #AutoLoot.Storages.Slots do if getPlayerStorageValue(cid, AutoLoot.Storages.Slots[i]) == -1 then doPlayerSetStorageValue(cid, AutoLoot.Storages.Slots[i], ItemID) return true end end end function AutoLoot.removeFromList(cid, name) local ItemID = getItemIdByName(name) for i = 1, #AutoLoot.Storages.Slots do if getPlayerStorageValue(cid, AutoLoot.Storages.Slots[i]) == ItemID then doPlayerSetStorageValue(cid, AutoLoot.Storages.Slots[i], -1) return true end end return false end function AutoLoot.Boost(cid) return tonumber(getPlayerStorageValue(cid, AutoLoot.Storage_Boost)) >= os.time() end function AutoLoot.Items(cid, position) if not isPlayer(cid) then return true end local Check, String, Position = false, "", {} for i = 1, 255 do position.stackpos = i if getThingFromPos(position).uid and getThingFromPos(position).uid > 0 and isContainer(getThingFromPos(position).uid) then Position = position Check = true break end end if Check then local CorpseUID = AutoLoot.getContainerItemsInfo(getThingFromPos(Position).uid) if CorpseUID then for Index, Item in pairs(CorpseUID) do if Index < AutoLoot.CountTable(CorpseUID) then if Item.UID and Item.ItemID then if isContainer(Item.UID) then local Bag = AutoLoot.getContainerItemsInfo(Item.UID) for i = 1, AutoLoot.CountTable(Bag) do if isInArray(AutoLoot.getPlayerList(cid), Bag[i].ItemID) then if Bag[i].Count > 1 then if Bag[i].uid and Bag[i].uid > 0 then doRemoveItem(Bag[i].uid, Bag[i].Count) end doPlayerAddItem(cid, Bag[i].ItemID, Bag[i].Count) String = String.." ".. Bag[i].Count .." ".. getItemNameById(Bag[i].ItemID) .." +" else if Bag[i].uid and Bag[i].uid > 0 then doRemoveItem(Bag[i].uid) end if AutoLoot.Boost_Actived and AutoLoot.Boost(cid) then if AutoLoot_Boost[Bag[i].ItemID] then doPlayerSetBalance(cid, getPlayerBalance(cid) + AutoLoot_Boost[Bag[i].ItemID]) String = String.." 1 ".. getItemNameById(Bag[i].ItemID) .." (".. AutoLoot_Boost[Bag[i].ItemID] .."gp no banco) +" else doPlayerAddItem(cid, Bag[i].ItemID, 1) String = String.." 1 ".. getItemNameById(Bag[i].ItemID) .." +" end else doPlayerAddItem(cid, Bag[i].ItemID, 1) String = String.." 1 ".. getItemNameById(Bag[i].ItemID) .." +" end end end end end end end if isInArray(AutoLoot.getPlayerList(cid), Item.ItemID) then if Item.Count > 1 then if Item.UID and Item.UID > 0 then doRemoveItem(Item.UID, Item.Count) end doPlayerAddItem(cid, Item.ItemID, Item.Count) String = String.." ".. Item.Count .." ".. getItemNameById(Item.ItemID) .." +" else if Item.UID and Item.UID > 0 then doRemoveItem(Item.UID) end if AutoLoot.Boost_Actived and AutoLoot.Boost(cid) then if AutoLoot_Boost[Item.ItemID] then doPlayerSetBalance(cid,getPlayerBalance(cid) + AutoLoot_Boost[Item.ItemID]) String = String.." 1 "..getItemNameById(Item.ItemID).." ("..AutoLoot_Boost[Item.ItemID].."gps no banco) +" else doPlayerAddItem(cid, Item.ItemID, 1) String = String.." 1 "..getItemNameById(Item.ItemID).." +" end else doPlayerAddItem(cid, Item.ItemID, 1) String = String.." 1 "..getItemNameById(Item.ItemID).." +" end end end end end end AutoLoot.setPlayerTableStorage(cid, AutoLoot.Storages.Count_Table, {[1] = String, [2] = 0}) end function AutoLoot.Gold(cid, position) if not isPlayer(cid) then return true end local Check = false local Total_Gold = 0 local Position = {} for i = 1, 255 do position.stackpos = i if getThingFromPos(position).uid and getThingFromPos(position).uid > 0 and isContainer(getThingFromPos(position).uid) then Position = position Check = true break end end if Check then local CorpseUID = AutoLoot.getContainerItemsInfo(getThingFromPos(Position).uid) if CorpseUID then for Index, Item in pairs(CorpseUID) do if Item.UID and Item.ItemID then if Index < AutoLoot.CountTable(CorpseUID) then if isContainer(Item.UID) then local Bag = AutoLoot.getContainerItemsInfo(Item.UID) for i = 1, AutoLoot.CountTable(Bag) do if isInArray({2148, 2152, 2160}, Bag[i].ItemID) then local Multiplier = 1 if Bag[i].ItemID == 2148 then Multiplier = 1 elseif Bag[i].ItemID == 2152 then Multiplier = 100 elseif Bag[i].ItemID == 2160 then Multiplier = 10000 end if Bag[i].uid and Bag[i].uid > 0 then doRemoveItem(Bag[i].uid, Bag[i].Count) end doPlayerSetBalance(cid, getPlayerBalance(cid) + tonumber(Bag[i].Count) * Multiplier) Total_Gold = Total_Gold + Bag[i].Count * Multiplier doPlayerSetStorageValue(cid, AutoLoot.Storages.Count_Gold, tonumber(AutoLoot.getPlayerStorageZero(cid, AutoLoot.Storages.Count_Gold)) + tonumber(Item.Count) * tonumber(Multiplier)) end end end end if isInArray({2148, 2152, 2160}, Item.ItemID) then local Multiplier = 1 if Item.ItemID == 2148 then Multiplier = 1 elseif Item.ItemID == 2152 then Multiplier = 100 elseif Item.ItemID == 2160 then Multiplier = 10000 end if Item.UID and Item.UID > 0 then doRemoveItem(Item.UID, Item.Count) end doPlayerSetBalance(cid, getPlayerBalance(cid) + Item.Count * Multiplier) doPlayerSetStorageValue(cid, AutoLoot.Storages.Count_Gold, tonumber(AutoLoot.getPlayerStorageZero(cid, AutoLoot.Storages.Count_Gold)) + tonumber(Item.Count) * tonumber(Multiplier)) Total_Gold = Total_Gold + Item.Count * Multiplier end end end end end if Total_Gold > 0 then Total_Gold = Total_Gold - (Total_Gold * 0.2) Total_Gold = math.ceil(Total_Gold) doPlayerSetBalance(cid, getPlayerBalance(cid) + Total_Gold) local Table = AutoLoot.getPlayerTableStorage(cid, AutoLoot.Storages.Count_Table) Table[2] = Total_Gold AutoLoot.setPlayerTableStorage(cid, AutoLoot.Storages.Count_Table, Table) end end function AutoLoot.Message(cid) if not isPlayer(cid) then return true end local Table = AutoLoot.getPlayerTableStorage(cid, AutoLoot.Storages.Count_Table) if AutoLoot.CountTable(Table) >= 1 then if Table[1] then if Table[2] and Table[2] > 0 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: ".. Table[1] .." ".. Table[2] .." gold coins.") else if type(Table[1]) == "string" and string.len(Table[1]) > 1 then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..Table[1]) end end elseif not Table[1] then if Table[2] then doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "[Auto Loot System] Coletados: "..Table[2].." gold coins.") end end end doPlayerSetStorageValue(cid, AutoLoot.Storages.Count_Table, -1) end- Utito Tempo San Não cura e da paralyse
Poste seu script aqui. data/spells/scripts/support/sharpshooter.lua- É possível colocar uma coluna para aparecer a Residencia (townid) do lado do level??
<?php if(!defined('INITIALIZED')) exit; if(count($config['site']['worlds']) > 1) { foreach($config['site']['worlds'] as $idd => $world_n) { if($idd == (int) $_REQUEST['world']) { $world_id = $idd; $world_name = $world_n; } } } if(!isset($world_id)) { $world_id = 0; $world_name = $config['server']['serverName']; } if(count($config['site']['worlds']) > 1) { $main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD></TD><TD> <FORM ACTION="" METHOD=get><INPUT TYPE="hidden" NAME="subtopic" VALUE="whoisonline"><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"> <TABLE BORDER=0 CELLPADDING=1><TR><TD>Players online on world:</TD><TD><SELECT SIZE="1" NAME="world">'; foreach($config['site']['worlds'] as $id => $world_n) { if($id == $world_id) $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'" selected="selected">'.htmlspecialchars($world_n).'</OPTION>'; else $main_content .= '<OPTION VALUE="'.htmlspecialchars($id).'">'.htmlspecialchars($world_n).'</OPTION>'; } $main_content .= '</SELECT> </TD><TD><INPUT TYPE="image" NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif"> </TD></TR></TABLE></TABLE></FORM></TABLE>'; } $orderby = 'name'; if(isset($_REQUEST['order'])) { if($_REQUEST['order']== 'level') $orderby = 'level'; elseif($_REQUEST['order'] == 'vocation') $orderby = 'vocation'; } $players_online_data = $SQL->query('SELECT ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('flag') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('name') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('vocation') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('promotion') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('level') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('skull') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looktype') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookaddons') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookhead') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookbody') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('looklegs') . ', ' . $SQL->tableName('players') . '.' . $SQL->fieldName('lookfeet') . ' FROM ' . $SQL->tableName('accounts') . ', ' . $SQL->tableName('players') . ' WHERE ' . $SQL->tableName('players') . '.' . $SQL->fieldName('world_id') . ' = ' . $SQL->quote($world_id) . ' AND ' . $SQL->tableName('players') . '.' . $SQL->fieldName('online') . ' = ' . $SQL->quote(1) . ' AND ' . $SQL->tableName('accounts') . '.' . $SQL->fieldName('id') . ' = ' . $SQL->tableName('players') . '.' . $SQL->fieldName('account_id') . ' ORDER BY ' . $SQL->fieldName($orderby))->fetchAll(); $number_of_players_online = 0; $vocations_online_count = array(0,0,0,0,0); // change it if you got more then 5 vocations $players_rows = ''; foreach($players_online_data as $player) { $vocations_online_count[$player['vocation']] += 1; $bgcolor = (($number_of_players_online++ % 2 == 1) ? $config['site']['darkborder'] : $config['site']['lightborder']); $skull = ''; if ($player['skull'] == 4) $skull = "<img style='border: 0;' src='./images/skulls/redskull.gif'/>"; else if ($player['skull'] == 5) $skull = "<img style='border: 0;' src='./images/skulls/blackskull.gif'/>"; $players_rows .= '<TR BGCOLOR='.$bgcolor.'><TD WIDTH=5%><img src="' . $config['site']['outfit_images_url'] . '?id=' . $player['looktype'] . '&addons=' . $player['lookaddons'] . '&head=' . $player['lookhead'] . '&body=' . $player['lookbody'] . '&legs=' . $player['looklegs'] . '&feet=' . $player['lookfeet'] . '" alt="" /></td><TD WIDTH=65%><A HREF="?subtopic=characters&name='.urlencode($player['name']).'">'.htmlspecialchars($player['name']).$skull.'<img src="' . $config['site']['flag_images_url'] . $player['flag'] . $config['site']['flag_images_extension'] . '" title="Country: ' . $player['flag'] . '" alt="' . $player['flag'] . '" /></A></TD><TD WIDTH=10%>'.$player['level'].'</TD><TD WIDTH=10%>'.$towns_list[$player->getWorld()][$player->getTownId()].'</TD><TD WIDTH=20%>'.htmlspecialchars($vocation_name[$player['promotion']][$player['vocation']]).'</TD></TR>'; } if($number_of_players_online == 0) { //server status - server empty $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently no one is playing on <b>'.htmlspecialchars($config['site']['worlds'][$world_id]).'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>'; } else { //server status - someone is online $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently '.$number_of_players_online.' players are online - <b>'.$config['status']['serverStatus_players'] .' ' . (($config['status']['serverStatus_players'] > 1) ? 'are' : 'is') . ' active</b> and <b>'.($number_of_players_online-$config['status']['serverStatus_players']).' ' . (($number_of_players_online-$config['status']['serverStatus_players'] > 1) ? 'are' : 'is') . ' AFK</b> on <b>'.htmlspecialchars($config['site']['worlds'][$world_id]).'</b>.</TD></TR></TABLE></TD></TR></TABLE><BR>'; $main_content .= '<table width="200" cellspacing="1" cellpadding="0" border="0" align="center"> <tbody> <tr> <tr bgcolor="'.$config['site']['darkborder'].'"> <td><img src="images/vocations/sorcerer.png" /></td> <td><img src="images/vocations/druid.png" /></td> <td><img src="images/vocations/paladin.png" /></td> <td><img src="images/vocations/knight.png" /></td> </tr> <tr> <tr bgcolor="'.$config['site']['vdarkborder'].'"> <td style="text-align: center;"><strong style="color:white">Sorcerers</strong></td> <td style="text-align: center;"><strong style="color:white">Druids</strong></td> <td style="text-align: center;"><strong style="color:white">Paladins</strong></td> <td style="text-align: center;"><strong style="color:white">Knights</strong></td> </tr> <tr> <TR BGCOLOR="'.$config['site']['lightborder'].'"> <td style="text-align: center;">'.$vocations_online_count[1].'</td> <td style="text-align: center;">'.$vocations_online_count[2].'</td> <td style="text-align: center;">'.$vocations_online_count[3].'</td> <td style="text-align: center;">'.$vocations_online_count[4].'</td> </tr> </tbody> </table> <div style="text-align: center;"> </div>'; //list of players $main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS="white"><b>Outfit</b></TD><TD><A HREF="?subtopic=whoisonline&order=name&world='.$world_id.'" CLASS=white>Name</A></TD><TD><A HREF="?subtopic=whoisonline&order=level&world='.urlencode($world_id).'" CLASS=white>Level</A></TD><TD><A HREF="?subtopic=whoisonline&order=vocation&world='.urlencode($world_id).'" CLASS=white>Vocation</TD></TR>'.$players_rows.'</TABLE>'; //search bar $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>'; }- Premium points Transfer Document
- Save player and House
Fala galerinha do TK, aqui vai um script muito útil para vários servidores. O script serve para salvar o player e a house do mesmo, utilizando o comando !save. O script foi testado em OTXServer 2. local Configs = { Exhausted = 180, Storage_Exhausted = 5000001, Messages = { SALVED = "You character has been salved.", EXHAUST = "You need wait %d seconds to save again.", }, } local function doSavePlayerAndHouse(cid) doPlayerSave(cid) if getHouseByPlayerGUID(getPlayerGUID(cid)) then doSaveHouse(getHouseByPlayerGUID(getPlayerGUID(cid))) end return true end function onSay(cid, words, param) if getPlayerStorageValue(cid, Configs.Storage_Exhausted) >= os.time() then doPlayerSendCancel(cid, string.format(Configs.Messages.EXHAUST, getPlayerStorageValue(cid, Configs.Storage_Exhausted) - os.time())) return true end doSavePlayerAndHouse(cid) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, Configs.Messages.SALVED) setPlayerStorageValue(cid, Configs.Storage_Exhausted, os.time() + Configs.Exhausted) return true end Tag do talkactions.xml <talkaction words="/save;!save" event="script" value="SavePlayers.lua"/>- (Resolvido)Anunciando evento
local cf = { teleportPosition = {x = 167, y = 49, z = 7, stackpos = 1}, -- Where the teleport will be created teleportToPosition = {x = 540, y = 665, z = 7}, -- Where the teleport will take you from = {x=508,y=641,z=7}, -- left top corner of event room to = {x=575,y=691,z=7} -- right bottom corner of event room } local function LoopEffectInTeleport(Position) local Teleport = getTileItemById(Position, 1387).uid if Teleport > 0 then doSendMagicEffect(Position, 55) doSendMagicEffect(Position, 56) addEvent(LoopEffectInTeleport, 5 * 1000) end end function onTime() doItemSetAttribute(doCreateTeleport(1387, cf.teleportToPosition, cf.teleportPosition), "aid", 1747) doBroadcastMessage("FireStorm event starting in 3 minutes! The teleport will be closed when the event start!", MESSAGE_STATUS_WARNING) LoopEffectInTeleport(cf.teleportToPosition) setGlobalStorageValue(17, 0) addEvent(startEventF, 3 * 60 * 1000) return true end function startEventF () doRemoveItem(getTileItemById(cf.teleportPosition, 1387).uid, 1) if getGlobalStorageValue(17) > 0 then addEvent(doRepeatCheckFireStorm, 5 * 1000) doBroadcastMessage("Good luck in the FireStorm event people! The teleport has closed!", MESSAGE_STATUS_WARNING) else doBroadcastMessage('FireStorm Event hasn\'t started beacuse there were not enough players.') end end y, x = 1, 1 function doRepeatCheckFireStorm () if getGlobalStorageValue(17) > 0 then local xTable, yTable, playerTable = {}, {}, {} for x = cf.from.x, cf.to.x do for y = cf.from.y, cf.to.y do table.insert(xTable, x) table.insert(yTable, y) local n, i = getTileInfo({x=x, y=y, z=cf.to.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=cf.to.z, stackpos=i}).uid while v ~= 0 do if isPlayer(v) then table.insert(playerTable, v) if n == #playerTable then break end end i = i + 1 v = getThingfromPos({x=x, y=y, z=cf.to.z, stackpos=i}).uid end end end end if #playerTable == 1 then doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true) doItemSetAttribute(doPlayerAddItem(playerTable[1], 7371), "name", "trophy " .. getCreatureName(playerTable[1]) .. "! Congratulations! Winner a fire event") doPlayerAddItem(playerTable[1],9971,2) doPlayerAddItem(playerTable[1],10559,15) doBroadcastMessage('FireStorm Event has finished. The winner is ' .. getCreatureName(playerTable[1]) .. '. Congratulations.') setGlobalStorageValue(17, 0) x, y = 1, 1 elseif #playerTable > 1 then for a = 1, y do local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7} for _, player in ipairs(playerTable) do local pPos = getThingPos(player) if pPos.x == pos.x and pPos.y == pos.y and pPos.z == pos.z then doTeleportThing(player, getTownTemplePosition(getPlayerTown(playerTable[1])), true) end end doSendDistanceShoot({x = pos.x - math.random(4, 6), y = pos.y - 5, z = pos.z}, pos, CONST_ANI_FIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_HITBYFIRE) addEvent(doSendMagicEffect, 150, pos, CONST_ME_FIREAREA) math.random(100,1000) end if x == 5 * y then y = y + 1 end x = x + 1 else doBroadcastMessage('No one have won in Fire Storm Event.') setGlobalStorageValue(17, 0) x, y = 1, 1 end addEvent(doRepeatCheckFireStorm, 1000) end end Testa ai.- (Resolvido)Anunciando evento
Os efeitos é só pra quando o evento estiver aberto correto?- Script eject
Não deve ser problema no script e sim nas configurações da TownID da house, do player ou do depot que você está abrindo.- (Resolvido)Anunciando evento
Posta o globalevents do evento.- Alavanca que teleporta
Script LeverHunt.lua local Configs = { Item_Necessary_ID = 2131, Item_Necessary_Count = 1, Enter = { {x = 159, y = 386, z = 6}, {x = 160, y = 386, z = 6}, {x = 161, y = 386, z = 6}, {x = 162, y = 386, z = 6} }, Exit_Position = {x = 160, y = 390, z = 6} } local function checkPlayersInTile() local Players = {} for i = 1, #Configs.Enter do local pid = getTopCreature(Configs.Enter[i]).uid if isPlayer(pid) and getPlayerItemCount(pid, Configs.Item_Necessary_ID) >= Configs.Item_Necessary_Count then table.insert(Players, pid) end end return Players end function onUse(cid, item, fromPosition, itemEx, toPosition) if #checkPlayersInTile() == 4 then for i, pid in pairs(checkPlayersInTile()) do doTeleportThing(pid, Configs.Exit_Position) doSendMagicEffect(getThingPos(pid), CONST_ME_TELEPORT) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Ops, não tem 4 players.") end return true end Tag: <action actionid="2001" event="script" value="LeverHunt.lua"/>- Erro Zombie Event
Dento do script fechazombie.lua no globalevents pesquise por: function onTimer() e altere por: function onTime()- Item Storage
Explica direito oque você quer, isso que criei é somente pra setar storage.- [860] Wand que cria portal
local Configs = { Teleport_ID = 1387, Effect = 10, Time_To_Remove = 60, Exhaust_Use = 120, Destinations = { {x = 85, y = 121, z = 6}, {x = 85, y = 122, z = 6}, {x = 85, y = 123, z = 6}, {x = 86, y = 121, z = 6}, {x = 86, y = 122, z = 6} } } local function isWalk(cid, Position) Position.stackpos = 0 if getTileThingByPos(Position).uid ~= 0 then local TileInfo = getTileInfo(Position) if getTopCreature(Position).uid == 0 and doTileQueryAdd(cid, Position) == RETURNVALUE_NOERROR then return true end end end local function removeTeleport(Position) local Teleport = getTileItemById(Position, Configs.Teleport_ID).uid if Teleport > 0 then doSendMagicEffect(Position, CONST_ME_POFF) doRemoveItem(Teleport) end return true end local function checkPosition(Position) for i = 1, #Configs.Destinations do if Position.x == Configs.Destinations[i].x and Position.y == Configs.Destinations[i].y and Position.z == Configs.Destinations[i].z then return false end end return true end function onUse(cid, item, fromPosition, itemEx, toPosition) local Exhausted = getPlayerStorageValue(cid, 55335) if os.time() < Exhausted then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wait ".. Exhausted - os.time() .." seconds to create another teleport.") return true end if isWalk(cid, toPosition) and checkPosition(toPosition) then setPlayerStorageValue(cid, 55335, os.time() + Configs.Exhaust_Use) doCreateTeleport(Configs.Teleport_ID, Configs.Destinations[math.random(1, #Configs.Destinations)], toPosition) doSendMagicEffect(toPosition, Configs.Effect) addEvent(removeTeleport, Configs.Time_To_Remove * 1000, toPosition) else doPlayerSendCancel(cid, "Sorry, not possible.") doSendMagicEffect(toPosition, CONST_ME_POFF) end return true end- mc nao pode se atakar
function onLogin(cid) registerCreatureEvent(cid, "MC_Block_Target") registerCreatureEvent(cid, "MC_Block_Combat") return true end function onTarget(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerIp(cid) == getPlayerIp(target) then return false end return true end return true end function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerIp(cid) == getPlayerIp(target) then return false end return true end return true end <event type="login" name="MC_Block_Login" event="script" value="NoTargetMC.lua"/> <event type="target" name="MC_Block_Target" event="script" value="NoTargetMC.lua"/> <event type="combat" name="MC_Block_Combat" event="script" value="NoTargetMC.lua"/>- Preciso de uma script urgente
Em data/creaturescripts/scripts adicione um arquivo chamado Kill_Pks.lua local Configs = { Crystal_Coin_ID = 2160, Count = 5, } function onLogin(cid) registerCreatureEvent(cid, "Kill_PKS") return true end function onKill(cid, target) if isPlayer(target) and isPlayer(cid) then if getCreatureSkull(target) == SKULL_WHITE then doPlayerAddItem(cid, Configs.Crystal_Coin_ID, Configs.Count) end end return true end Em data/creaturescripts/creaturescripts.xml adicione a tag: <event type="kill" name="Kill_PKS" event="script" value="Kill_Pks.lua"/>- Item Storage
Script local Storages = {1, 2, 3, 4, 5} function onUse(cid, item, fromPosition, itemEx, toPosition) for i = 1, #Storages do setPlayerStorageValue(cid, Storages[i], 1) end return true end XML <action itemid="ID DO ITEM" event="script" value="NOME DO SCRIPT.lua"/>- [PEDIDO]Script que order não funciona em pz
local skills = specialabilities local surfborders = {4644, 4645, 4646, 4647, 4648, 4649, 4650, 4651, 4652, 4653, 4654, 4655, 4656, 4657, 4658, 4659, 4660, 4661, 4662, 4663} local txt = { ["rock smash"] = {"break that rock!", "smash that rock!", "destroy that rock!", "smash it!", "break it!", "destroy it!"}, ["cut"] = {"cut that bush!", "cut it down!", "cut it off!", "cut off that bush!", "cut down that bush!", "cut that bush down!"}, ["move"] = {"move!", "move there!", "go there!", "walk there!"}, ["light"] = {"flash!", "light!", "flash this place!", "light up this place!"}, ["dig"] = {"open that hole!", "dig that hole!", "open it!", "dig it!"}, ["blink"] = {"teleport there!", "blink there!", "blink!", "teleport!"}, ["ride"] = {"let me ride you!", "let's ride!", "let me mount you!", "let me get on you!"}, ["fly"] = {"let's fly!", "let me get on you!"} , ["untransform"] = {"go back to normal!", "transform into yourself again!", "stop transformation!"}, ["headbutt"] = {"headbutt on three", "headbutt that three!", "headbutt it off"}, --alterado v2.6 } function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid,130130) >= 1 then doPlayerSendTextMessage(cid, 19, "Nao Pode Dar Order Nessa Area.") return true end if getPlayerStorageValue(cid,6598754) >= 1 or getPlayerStorageValue(cid, 6598755) >= 1 then doPlayerSendTextMessage(cid, 19, "[Order] Nao Pode usa Order Nessa Area.") return true end if getTilePzInfo(getPlayerPosition(cid)) then doPlayerSendTextMessage(cid, 19, "[Order] Nao Pode usa Order em protect zone.") return true end local checkpos = topos checkpos.stackpos = 0 if getTileThingByPos(checkpos).uid <= 0 then return true end --------END FLY/RIDE -------- if getCreatureCondition(cid, CONDITION_OUTFIT) and (item2.uid == cid or getRecorderPlayer(topos) == cid) and (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1) then if isInArray({460, 11675, 11676, 11677}, getTileInfo(getThingPos(cid)).itemid) then doPlayerSendCancel(cid, "You can\'t stop flying at this height!") return true end local item = getPlayerSlotItem(cid, 8) local pokemon = getItemAttribute(item.uid, "poke") local x = pokes[pokemon] if getTileInfo(getThingPos(cid)).itemid >= 4820 and getTileInfo(getThingPos(cid)).itemid <= 4825 then doPlayerSendCancel(cid, "You can\'t stop flying above the water!") return true end doSummonMonster(cid, pokemon) local pk = getCreatureSummons(cid)[1] if not isCreature(pk) then pk = doCreateMonster(pokemon, backupPos) if not isCreature(pk) then doPlayerSendCancel(cid, "You can't stop flying/riding here.") return true end doConvinceCreature(cid, pk) end doTeleportThing(pk, getThingPos(cid), false) doCreatureSetLookDir(pk, getCreatureLookDir(cid)) adjustStatus(pk, item.uid, true, false, true) doPlayerSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", let me get down!", 19) doRegainSpeedLevel(cid) doRemoveCondition(cid, CONDITION_OUTFIT) local pkpkpk = getCreatureSummons(cid)[1] local pkjg = getPlayerSlotItem(cid, 8).uid local pkza = getPlayerSlotItem(cid, 8).uid local pkxd = getItemAttribute(pkjg,"addon") if not pkxd then doSetItemAttribute(pkza,"addon",0) elseif pkxd > 0 then doSetCreatureOutfit(pkpkpk, {lookType = pkxd}, -1) end setPlayerStorageValue(cid, 17000, -1) setPlayerStorageValue(cid, 17001, -1) return true end if #getCreatureSummons(cid) == 0 then return doPlayerSendCancel(cid, "You need a pokemon to use order!") end if getCreatureNoMove(getCreatureSummons(cid)[1]) then return true end markLP(getCreatureSummons(cid)[1], -1) if getMarkedPos(getCreatureSummons(cid)[1]).x == topos.x and getMarkedPos(getCreatureSummons(cid)[1]).y == topos.y then return true end local unfix = {x = 1, y = 1, z = 1} local thisball = getPlayerSlotItem(cid, 8) local mysum = getCreatureSummons(cid)[1] local sid = mysum or cid local maxMoveDist = getDistanceBetween(getThingPos(sid), topos) * 2 + 1 markPos(mysum, topos) markOwnerPos(mysum, getThingPos(cid)) -------- ROCK SMASH --------- if item2.itemid == 1285 and isInArray(skills["rock smash"], getPokemonName(mysum)) then doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["rock smash"][math.random(1, #txt["rock smash"])].."", 19) addEvent(goThere, 500, mysum, topos, "rock smash", isCreature(getCreatureTarget(cid))) return true end ----------------------------- -------- HEADBUTT ----------- if item2.itemid == 12591 and getPokemonLevel(mysum) >= 15 then --alterado v2.6 --id do item arvore normal doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["headbutt"][math.random(1, #txt["headbutt"])].."", 19) addEvent(goThere, 500, mysum, topos, "headbutt", isCreature(getCreatureTarget(cid))) return true end ----------------------------- -------- CUT ---------------- if item2.itemid == 2767 and isInArray(skills["cut"], getPokemonName(mysum)) then doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["cut"][math.random(1, #txt["cut"])].."", 19) addEvent(goThere, 500, mysum, topos, "cut", isCreature(getCreatureTarget(cid))) return true end ----------------------------- -------- TRANSFORM ---------- if getCreatureName(mysum) == "Ditto" and isMonster(item2.uid) then if item2.uid == mysum then if isTransformed(mysum) then deTransform(mysum, getItemAttribute(thisball.uid, "transTurn")) markPos(mysum, unfix) doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["untransform"][math.random(1, #txt["untransform"])].."", 19) return true end doPlayerSendCancel(cid, "Your ditto is not transformed.") markPos(mysum, unfix) return true end if getCreatureName(item2.uid) == "Ditto" then doPlayerSendCancel(cid, "Your ditto can't transform into another ditto.") markPos(mysum, unfix) return true end if getCreatureName(item2.uid) == getPlayerStorageValue(mysum, 1010) then doPlayerSendCancel(cid, "Your ditto is already transformed into that pokemon.") markPos(mysum, unfix) return true end local cd = getCD(thisball.uid, "trans", 40) if cd > 0 then doPlayerSendCancel(cid, "Your pokemon is too tired to transform again. Cooldown: ("..getStringmytempo(cd)..")") return true end if getHappiness(mysum) <= 50 then doSendMagicEffect(getThingPos(mysum), happinessRate[1].effect) markPos(mysum, unfix) return true end local turn = getItemAttribute(thisball.uid, "transTurn") if not turn or turn > 10 then doItemSetAttribute(thisball.uid, "transTurn", 0) else doItemSetAttribute(thisball.uid, "transTurn", turn + 1) end local time = 140 + 2 * getPokemonLevel(mysum) turn = getItemAttribute(thisball.uid, "transTurn") markPos(mysum, unfix) setPlayerStorageValue(mysum, 1010, getCreatureName(item2.uid)) doSetCreatureOutfit(mysum, getCreatureOutfit(item2.uid), -1) addEvent(deTransform, time * 1000, mysum, turn) doSendMagicEffect(getThingPos(mysum), 184) doCreatureSay(mysum, "TRANSFORM!", TALKTYPE_MONSTER) local name = getCreatureName(item2.uid) setCD(thisball.uid, "trans", 40) doItemSetAttribute(thisball.uid, "transBegin", os.clock()) doSetItemAttribute(thisball.uid, "transLeft", time) doSetItemAttribute(thisball.uid, "transOutfit", getCreatureOutfit(item2.uid).lookType) doSetItemAttribute(thisball.uid, "transName", getCreatureName(item2.uid)) doFaceCreature(mysum, getThingPos(item2.uid)) doPlayerSay(cid, ""..getPokeName(mysum)..", transform into "..getArticle(name).." "..name.."!", 19) if useKpdoDlls then doUpdateMoves(cid) --alterado v2.6 end if dittoCopiesStatusToo then doSetItemAttribute(thisball.uid, "boffense", dittoBonus * getOffense(item2.uid)) doSetItemAttribute(thisball.uid, "bdefense", dittoBonus * getDefense(item2.uid)) doSetItemAttribute(thisball.uid, "bsattack", dittoBonus * getSpecialAttack(item2.uid)) doSetItemAttribute(thisball.uid, "bagility", dittoBonus * getSpeed(item2.uid)) adjustStatus(mysum, thisball.uid) end return true end ----------------------------- -------- LIGHT -------------- if isMonster(item2.uid) and getCreatureMaster(item2.uid) == cid then markPos(mysum, unfix) if not isInArray(skills["light"], getPokemonName(item2.uid)) then doPlayerSendCancel(cid, "Your pokemon can't use flash.") return true end local cd = getCD(thisball.uid, "light", 30) if cd > 0 then doPlayerSendCancel(cid, "Your pokemon is too tired to use flash. Cooldown: ("..getStringmytempo(cd)..")") return true end doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["light"][math.random(1, #txt["light"])].."", 19) doCreatureSay(mysum, "FLASH!", TALKTYPE_MONSTER) doSendMagicEffect(getThingPos(mysum), 28) local size = 5 size = size + math.floor(getSpecialAttack(mysum) / 60) size = size + math.ceil(getPokemonLevel(mysum) / 60) if size > 11 then size = 11 end doSetCreatureLight(mysum, size, 215, 600*1000) local delay = math.floor(30 - getPokemonLevel(mysum) / 4) if delay > 0 then setCD(thisball.uid, "light", delay) end return true end ----------------------------- -------- DIG ---------------- if isInArray(skills["digholes"], item2.itemid) and isInArray(skills["dig"], getPokemonName(mysum)) then doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["dig"][math.random(1, #txt["dig"])].."", 19) addEvent(goThere, 500, mysum, topos, "dig", isCreature(getCreatureTarget(cid))) return true end ----------------------------- -------- BLINK / MOVE ------- if not isCreature(item2.uid) and isInArray(skills["blink"], getPokemonName(mysum)) then local cd = getCD(thisball.uid, "blink", 30) if getPlayerStorageValue(mysum, 2365487) == 1 then return true --alterado v2.4 end if cd > 0 or not canWalkOnPos(topos, false, false, true, true, true) then doPlayerSendCancel(cid, "Blink cooldown: ("..getStringmytempo(cd)..")") doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["move"][math.random(1, #txt["move"])].."", 19) addEvent(goThere, 500, mysum, topos, "move", isCreature(getCreatureTarget(cid)), maxMoveDist) return true end local CD = isShinyName(getCreatureName(mysum)) and 20 or 30 --edited blink markPos(mysum, topos) markOwnerPos(mysum, getThingPos(cid)) setCD(thisball.uid, "blink", CD) doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["blink"][math.random(1, #txt["blink"])].."", 19) doSendDistanceShoot(getThingPos(mysum), topos, 39) doSendMagicEffect(getThingPos(mysum), 211) doTeleportThing(mysum, topos, false) doSendMagicEffect(topos, 134) doCreatureSay(mysum, "BLINK!", TALKTYPE_MONSTER) goThere(mysum, topos, "blink", isCreature(getCreatureTarget(cid))) --edited blink return true end ----------------------------- ----START FLYorRIDE --------- if (item2.uid == cid or getRecorderPlayer(topos) == cid) and (isInArray(skills["fly"], getPokemonName(mysum)) or isInArray(skills["ride"], getPokemonName(mysum))) then if getPlayerStorageValue(cid, 212124) >= 1 then --alterado v2.6 return doPlayerSendCancel(cid, "You can't do it with a pokemon with mind controlled!") end if getPlayerStorageValue(cid, 52480) >= 1 then return doPlayerSendCancel(cid, "You can't do it while a duel!") --alterado v2.6 end if getPlayerStorageValue(cid, 5700) == 1 then doPlayerSendCancel(cid, "You can't do that while is mount in a bike!") --edited proteçao pra bike return true end local pct = getCreatureHealth(mysum) / getCreatureMaxHealth(mysum) doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "hp", 1 - pct) if isInArray(skills["fly"], getPokemonName(mysum)) then doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["fly"][math.random(1, #txt["fly"])].."", 19) addEvent(goThere, 500, mysum, topos, "fly", isCreature(getCreatureTarget(cid))) else doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["ride"][math.random(1, #txt["ride"])].."", 19) addEvent(goThere, 500, mysum, topos, "ride", isCreature(getCreatureTarget(cid))) end return true end ----------------------------------Control Mind-------------------------------------------- alterado v2.5 if isCreature(item2.uid) and ehMonstro(item2.uid) and isInArray(skills["control mind"], getCreatureName(mysum)) and item2.uid ~= mysum then if not isCreature(item2.uid) then return true end if isSleeping(mysum) then return doPlayerSendCancel(cid, "Your pokemon is sleeping...zZzZ") end if getTileInfo(getThingPos(cid)).protection or getTileInfo(getThingPos(getCreatureSummons(cid)[1])).protection then return doPlayerSendCancel(cid, "You or your pokemon are in Pz zone!") end if #getCreatureSummons(cid) == 2 then return doPlayerSendCancel(cid, "You only can control one Pokemon!") end local cd = getCD(thisball.uid, "control", 120) if cd > 0 then doPlayerSendCancel(cid, "You have to wait "..cd.." segs to use Control Mind again!") return true end if getPokemonLevel(item2.uid) >= getPokemonLevel(mysum) then return doPlayerSendCancel(cid, "Your pokemon can't control this mind!") end local cmed = item2.uid setCD(thisball.uid, "control", 120) doSendDistanceShoot(getThingPos(mysum), getThingPos(cmed), 39) -------------- setPlayerStorageValue(cid, 212124, 1) doConvinceCreature(cid, cmed) setPlayerStorageValue(cmed, 212123, 1) doCreatureSay(cid, ""..getCreatureName(mysum)..", control "..string.lower(getCreatureName(cmed)).."'s mind!", 19) local cmname = getCreatureName(mysum) local cmpos = getThingPos(mysum) local pokelife = (getCreatureHealth(mysum) / getCreatureMaxHealth(mysum)) doItemSetAttribute(thisball.uid, "hp", pokelife) doRemoveCreature(mysum) local cmzao = doSummonCreature(""..cmname.." cm", cmpos) doConvinceCreature(cid, cmzao) setPlayerStorageValue(cid, 888, 1) if useKpdoDlls then doUpdateMoves(cid) end local function check(cid, controled, rod) if isCreature(cid) then ball2 = getPlayerSlotItem(cid, 8) if getPlayerStorageValue(cid, 888) <= 0 then return true end if not isCreature(controled) then setPlayerStorageValue(cid, 212124, 0) local sum = isCreature(getCreatureSummons(cid)[1]) and getCreatureSummons(cid)[1] or getCreatureSummons(cid)[2] local pkcmpos = getThingPos(sum) doRemoveCreature(sum) local item = getPlayerSlotItem(cid, 8) local pk = doSummonCreature(getItemAttribute(item.uid, "poke"), pkcmpos) doConvinceCreature(cid, pk) doCreatureSetLookDir(getCreatureSummons(cid)[1], 2) addEvent(doAdjustWithDelay, 100, cid, pk, true, true, false) setPlayerStorageValue(cid, 888, 0) cleanCMcds(item.uid) registerCreatureEvent(pk, "SummonDeath") --alterado v2.6 if useKpdoDlls then doUpdateMoves(cid) end return true end if rod <= 0 then --Pokemon controlado local cmed2 = getCreatureSummons(cid)[1] local poscmed = getThingPos(cmed2) local cmeddir = getCreatureLookDir(cmed2) local namecmed = getCreatureName(cmed2) local gender = getPokemonGender(cmed2) local level = getWildPokemonLevel(cmed2) local hp, maxHp = getCreatureHealth(getCreatureSummons(cid)[1]), getCreatureMaxHealth(getCreatureSummons(cid)[1]) doRemoveCreature(getCreatureSummons(cid)[1]) local back = doCreateMonster(namecmed, poscmed) addEvent(doCreatureSetSkullType, 150, back, gender) addEvent(setWildPokemonLevel, 150, back, level) doWildAttackPlayer(back, cid) doCreatureSetLookDir(back, cmeddir) addEvent(doCreatureAddHealth, 100, back, hp-maxHp) -- pokemon controlador local mynewpos = getThingPos(getCreatureSummons(cid)[1]) doRemoveCreature(getCreatureSummons(cid)[1]) local pk2 = doSummonCreature(getItemAttribute(ball2.uid, "poke"), mynewpos) doConvinceCreature(cid, pk2) addEvent(doAdjustWithDelay, 100, cid, pk2, true, true, false) setPlayerStorageValue(cid, 888, 0) doCreatureSetLookDir(getCreatureSummons(cid)[1], 2) setPlayerStorageValue(cid, 212124, 0) cleanCMcds(ball2.uid) registerCreatureEvent(pk2, "SummonDeath") --alterado v2.6 if useKpdoDlls then doUpdateMoves(cid) end else if isInArray({"Haunter", "Gengar", "Shiny Gengar"}, cmname) then doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 214) else doSendMagicEffect(getThingPos(getCreatureSummons(cid)[1]), 220) end end end addEvent(check, 500, cid, controled, rod-1) end check(cid, cmed, 40) return true end --------------------------------------------------------------------- -------- MOVE / END --------- local onlyWater = false if isWater(getTileThingByPos(checkpos).itemid) then onlyWater = true for checkwater = 0, 7 do if not isWater(getTileThingByPos(getPosByDir(checkpos, checkwater)).itemid) then onlyWater = false end end end if onlyWater then doPlayerSendCancel(cid, "Destination is not reachable.") return true end doPlayerSay(cid, ""..getPokeName(mysum)..", "..txt["move"][math.random(1, #txt["move"])].."", 19) if isCreature(getCreatureTarget(cid)) then goThere(mysum, topos, "move", isCreature(getCreatureTarget(cid)), maxMoveDist) else addEvent(goThere, 500, mysum, topos, "move", isCreature(getCreatureTarget(cid)), maxMoveDist) end ----------------------------- return true end - (Resolvido)[Erro] função creature:moveTo
Informação Importante
Confirmação de Termo