Ir para conteúdo

pnonopuq

Campones
  • Total de itens

    0
  • Registro em

  • Última visita

Sobre pnonopuq

Informações

  • Forma que conheci o xTibia
    Amigos
  • Sou
    Mapper

pnonopuq's Achievements

  1. Bem, eu tenho esse codigo abaixo. Onde eu tenho que configurar a posicao inicial do jogador,a posicao dos demons e a posicao depois que os jogadores puxarem a alavanca? 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 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 = 140 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[i] = getThingfromPos(players_pos[i]) if player[i].itemid > 0 then if string.lower(playersOnly) == "yes" then if isPlayer(player[i].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[i] = getThingfromPos(players_pos[i]) if isPlayer(player[i].uid) == TRUE then if getPlayerLevel(player[i].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, #players_pos do doSendMagicEffect(players_pos[i], CONST_ME_POFF) doTeleportThing(player[i].uid, new_player_pos[i], FALSE) doSendMagicEffect(new_player_pos[i], 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
  2. pnonopuq

    Npc De Casamento

    Boa tarde pessoal Eu tenho esse script aqui do meu npc de casamento: local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if msgcontains(msg, 'marry') or msgcontains(msg, 'marriage') then if getPlayerStorageValue(cid,3066) == -1 then selfSay('Would you like to get married?', cid) talkState[talkUser] = 1 elseif getPlayerStorageValue(cid,3066) == 1 then local fid = getPlayerGUID(cid) local marrystatus = getOwnMarryStatus(fid) if marrystatus ~= 0 then local newpartner = getPlayerNameByGUID(marrystatus) selfSay('You already set a wedding date with {' .. newpartner .. '}, now I must talk to your partner. Do you want to {cancel} it?', cid) talkState[talkUser] = 5 else setPlayerStorageValue(cid,3066,-1) selfSay('Would you like to get married?', cid) talkState[talkUser] = 1 end elseif getPlayerStorageValue(cid,3066) == 2 then selfSay('You are already married. If you want to {divorce}, just say it.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'divorce') then if getPlayerStorageValue(cid,3066) == 2 then selfSay('Would you like to divorce of your partner?', cid) talkState[talkUser] = 6 else selfSay('You are not married. If you want to get married, just say {marry}.', cid) talkState[talkUser] = 0 end end if talkState[talkUser] == 1 then if msgcontains(msg, 'yes') then local fid = getPlayerGUID(cid) local marrystatus = getMarryStatus(fid) if marrystatus == FALSE then selfSay('And what\'s the name of your future partner?', cid) talkState[talkUser] = 2 else local marryname = getPlayerNameByGUID(marrystatus) selfSay('{' .. marryname .. '} has set a wedding date with you. Do you want to {proceed} or {cancel} the wedding?', cid) talkState[talkUser] = 4 end end elseif talkState[talkUser] == 2 then local p = msg local player = getPlayerName(cid) local fid = getPlayerGUID(cid) local sid = getPlayerGUIDByName(p) if sid == 0 then selfSay('A player with that name does not exists.', cid) talkState[talkUser] = 0 elseif sid == fid then selfSay('Don\'t worry, you will always be married with yourself, kid.', cid) talkState[talkUser] = 0 else local marrystatus = getMarryStatus(fid) local pmarriage = getPlayerMarriage(sid) local ownstatus = getOwnMarryStatus(cid) if pmarriage == FALSE then if marrystatus == FALSE then if ownstatus == FALSE then setPlayerStorageValue(cid,3066,1) addMarryStatus(fid,sid) selfSay('You\'ve just set a wedding date with {' .. p .. '}.', cid) talkState[talkUser] = 0 else local partnername = getPlayerNameByGUID(ownstatus) selfSay('{' .. p .. '} has already set a wedding date with {' .. partnername .. '}.', cid) talkState[talkUser] = 0 end else local marryname = getPlayerNameByGUID(marrystatus) selfSay('{' .. marryname .. '} has set a wedding date with you. Do you want to {proceed} or {cancel} the wedding?', cid) talkState[talkUser] = 4 end else local pname = getPlayerNameByGUID(pmarriage) selfSay('Sorry, but {' .. p .. '} is already married to {' .. pname .. '}.', cid) talkState[talkUser] = 0 end end elseif talkState[talkUser] == 4 then if msgcontains(msg, 'proceed') then local fid = getPlayerGUID(cid) local sid = getMarryStatus(fid) local marryname = getPlayerNameByGUID(sid) local pid = getPlayerByNameWildcard(marryname) local tmf = getCreaturePosition(cid) local tms = getCreaturePosition(pid) local text = {'I love you!','My love!','Baby dear!'} local chance1 = math.random(1,table.getn(text)) local chance2 = math.random(1,table.getn(text)) local dateFormat = "%A %d"..getMonthDayEnding(os.date("%d")).." %B %Y" local ring = doPlayerAddItem(cid,2121,1) local ring2 = doPlayerAddItem(pid,2121,1) if isOnline(fid) == TRUE and isOnline(sid) == TRUE then if getDistanceBetween(tmf, tms) <= 3 then setPlayerStorageValue(cid,3066,2) setPlayerStorageValue(pid,3066,2) doCancelMarryStatus(fid) doCancelMarryStatus(sid) setPlayerPartner(cid,sid) setPlayerPartner(pid,fid) doPlayerAddOutfitId(cid,34,0) doPlayerAddOutfitId(pid,34,0) doSetItemSpecialDescription(ring, "" .. getCreatureName(cid) .. " & " .. getCreatureName(pid) .. " forever - married on " ..os.date(dateFormat).. ".") doSetItemSpecialDescription(ring2, "" .. getCreatureName(cid) .. " & " .. getCreatureName(pid) .. " forever - married on " ..os.date(dateFormat).. ".") doCreatureSay(cid, text[chance1], TALKTYPE_ORANGE_1) doCreatureSay(pid, text[chance2], TALKTYPE_ORANGE_1) doSendMagicEffect(tmf, 35) doSendMagicEffect(tms, 35) selfSay('Congratulations! Now you may kiss your partner! Everytime you wanna make this effect, just say {love}. You must be close to your partner.', cid) talkState[talkUser] = 0 else selfSay('Your partner must be close to you so you can marry!', cid) talkState[talkUser] = 0 end else selfSay('You and your new partner must be online at the same time.', cid) talkState[talkUser] = 0 end elseif msgcontains(msg, 'cancel') then local fid = getPlayerGUID(cid) local sid = getMarryStatus(fid) local marryname = getPlayerNameByGUID(sid) local pid = getPlayerByNameWildcard(marryname) if isOnline(sid) == TRUE then setPlayerStorageValue(pid,3066,-1) end doCancelMarryStatus(sid) selfSay('You just canceled your wedding date with {' .. marryname .. '}.', cid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 5 then if msgcontains(msg, 'cancel') or msgcontains(msg, 'yes') then local fid = getPlayerGUID(cid) setPlayerStorageValue(cid,3066,-1) doCancelMarryStatus(fid) talkState[talkUser] = 0 end elseif talkState[talkUser] == 6 then if msgcontains(msg, 'yes') then local fid = getPlayerGUID(cid) local sid = getPlayerPartner(cid) local marryname = getPlayerNameByGUID(sid) local pid = getPlayerByNameWildcard(marryname) if (isOnline(fid) == TRUE and isOnline(sid) == TRUE) then setPlayerStorageValue(cid,3066,-1) setPlayerStorageValue(pid,3066,-1) setPlayerPartner(cid,0) setPlayerPartner(pid,0) doPlayerAddOutfitId(cid,34,-1) doPlayerAddOutfitId(pid,34,-1) selfSay('You\'ve just divorced of your old partner.', cid) talkState[talkUser] = 0 else selfSay('You and your new partner must be online at the same time.', cid) talkState[talkUser] = 0 end end end return TRUE end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) Meu pedido é assim. Quando os jogadores se casarem eles ganhem o outfit de husband se for homem e wife se for mulher. A unica forma de conseguir esses outfits serao dessa maneira (como eu faria para tirar esses outfits para outros jogadores? outfits.xml?). Quando eles finalmente se casarem, o npc muda o outfit atual deles para o de husband/wife que nem no global =D Att.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...