Postado Janeiro 25, 2015 10 anos Ola, tenho alguns eventos em meu servidor, como: Dota Event e Capture The Flag... Ambos funcionam normalmente, porém o uso de Magic Wall Rune e Wild Grouth Rune Ou seja, aquelas runas de trap... Creio não ser muito dificil, então peço a ajuda de vocês ! Capture the flag Creaturescripts function onLogin(cid) if getPlayerStorageValue(cid, 822066) == 1 or getPlayerStorageValue(cid, CTF.storages.redTeam) == 1 or getPlayerStorageValue(cid, CTF.storages.greenTeam) == 1 or getPlayerStorageValue(cid, CTF.storages.greenFlag) == 1 or getPlayerStorageValue(cid, CTF.storages.redFlag) == 1 then doPlayerSetStorageValue(cid, 822066, -1) doPlayerSetStorageValue(cid, CTF.storages.redTeam, -1) doPlayerSetStorageValue(cid, CTF.storages.greenTeam, -1) doPlayerSetStorageValue(cid, CTF.storages.redFlag, -1) doPlayerSetStorageValue(cid, CTF.storages.greenFlag, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, "Ocorreu algum problema com seu char e você foi enviado para seu templo. O erro já foi corrigido, não há razões para se preocupar.") end registerCreatureEvent(cid, "Ctfdeath") registerCreatureEvent(cid, "Ctfcombat") registerCreatureEvent(cid, "Ctfoutfit") return true end local function removeFlag(pos, id) local flag = getThingFromPos(pos) if flag and flag.uid > 0 and flag.itemid == id then doRemoveItem(flag.uid, 1) end end function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, CTF.storages.greenTeam) == 1 and getPlayerStorageValue(target, CTF.storages.greenTeam) == 1 or getPlayerStorageValue(cid, CTF.storages.redTeam) == 1 and getPlayerStorageValue(target, CTF.storages.redTeam) == 1 then return false end end return true end local function telep(cid) if isPlayer(cid) then doTeleportThing(cid, getPlayerStorageValue(cid, CTF.storages.greenTeam) == 1 and CTF.base_A or CTF.base_B) end end function onPrepareDeath(cid, deathList) if isPlayer(cid) and getPlayerStorageValue(cid, 822066) == 1 then addEvent(telep, 100, cid) doTeleportThing(cid, getPlayerStorageValue(cid, CTF.storages.greenTeam) == 1 and CTF.base_A or CTF.base_B) if getPlayerStorageValue(cid, CTF.storages.greenFlag) == 1 then doPlayerSetStorageValue(cid, CTF.storages.greenFlag, -1) local flag = doCreateItem(CTF.greenFlag, 1, CTF.greenFlagPos) doItemSetAttribute(flag, 'aid', 5434) warnPlayersWithStorage(822066, 1, MESSAGE_STATUS_WARNING, "O jogador "..getCreatureName(cid).." morreu com a Bandeira Verde e ela foi devolvida à sua base.") local pos = getThingPos(cid) addEvent(removeFlag, 200, pos, CTF.greenFlag) elseif getPlayerStorageValue(cid, CTF.storages.redFlag) == 1 then doPlayerSetStorageValue(cid, CTF.storages.redFlag, -1) local flag = doCreateItem(CTF.redFlag, 1, CTF.redFlagPos) doItemSetAttribute(flag, 'aid', 5435) warnPlayersWithStorage(822066, 1, MESSAGE_STATUS_WARNING, "O jogador "..getCreatureName(cid).." morreu com a Bandeira Vermelha e ela foi devolvida à sua base.") local pos = getThingPos(cid) addEvent(removeFlag, 200, pos, CTF.redFlag) end end return true end local outfit_tb = { [194] = 121211, -- Acolyte [193] = 121212, --- Enlightened [255] = 121213, -- Bloodwalker [254] = 121214, -- Slullhunter [253] = 121215, -- Headsplitter [264] = 121216, -- Brutetamer [98] = 121218, -- Pirate [306] = 121219 -- Gonka } function onOutfit(cid, old, current) if outfit_tb[current.lookType] then if getPlayerStorageValue(cid, outfit_tb[current.lookType]) ~= 1 then if current.lookType == 306 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não é digno de usar esse outfit. Somente aqueles que derrotaram o Gonka podem usá-lo.") doCreatureChangeOutfit(cid, old) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Você não pode usar este outfit pois ele é exclusivo. Para ter acesso a ele, compre em nossa shop do site.") end return false end end if getPlayerStorageValue(cid, 822066) == 1 then doPlayerSendCancel(cid, "N pode trocar outfit no CTF.") return false end return true end Editado Janeiro 25, 2015 10 anos por elli (veja o histórico de edições)
Postado Janeiro 25, 2015 10 anos @elli poderia mandar os creaturescript dos eventos , para eu fazer pra você ?
Postado Janeiro 25, 2015 10 anos Autor @elli poderia mandar os creaturescript dos eventos , para eu fazer pra você ? Sim, só 1 minuto. vou editar post @EDIT do Capture está ali Já o DOTA não tem nenhum creature events do msm .. Editado Janeiro 25, 2015 10 anos por elli (veja o histórico de edições)
Postado Janeiro 25, 2015 10 anos Agora no talkaction ou no negocio que starta o Evento você não me passou, lá você vai ter que setar pra cada jogador que entrar no evento a storage 2000 setPlayerStorageValue(cid, 2000, 1) foi a que eu usei nos scripts para a magic wall -- Novo creaturescript http://pastebin.com/HZJLQmFL Vá na pasta lib abra o arquivo 000-constant, no final do arquivo adicione isso function canUseRune(cid, storage) if getPlayerStorageValue(cid, storage) == 1 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't use rune") end end Isso vai servir para tu adicionar mais runas se quiser, no caso vai ser só mudar a storage Agora vá em spells/support , ache a magic wall rune e substitua por essa local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY) setCombatParam(combat, COMBAT_PARAM_CREATEITEM, 1497) function onCastSpell(cid, var) if canUseMagicWallRune(cid, 2000) then return true end return doCombat(cid, combat, var) end Editado Janeiro 25, 2015 10 anos por craigmabbit (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.