• logo_cipsoft
    Nowe serwery zostały otwarte 27 Paź 2025:
    Idyllia (Optional PvP) Hostera (Open PvP) us_logo Dracobra (Open PvP)

[8.*] Questy na outfity !!!

Status
Zamknięty.

ojczulek

Advanced User
Fajny skrypcik, znalaz?em go ponad rok temu gdzie? na otlandzie, zanik? jednak w sieci, usun??em go teraz z mojego ots'a, ale mo?e innym si? przyda.
do Actions.xml :
Kod:
    <!--Outfit Quests -->
     <action uniqueid="12001" event="script" value="allOutfits.lua"/>  -- Hunter 
     <action uniqueid="12002" event="script" value="allOutfits.lua"/>  -- Mage  
     <action uniqueid="12003" event="script" value="allOutfits.lua"/>  -- Knight 
     <action uniqueid="12004" event="script" value="allOutfits.lua"/>  -- Nobleman 
     <action uniqueid="12005" event="script" value="allOutfits.lua"/>  -- Summoner 
     <action uniqueid="12006" event="script" value="allOutfits.lua"/>  -- Warrior 
     <action uniqueid="12007" event="script" value="allOutfits.lua"/>  -- Barbarian 
     <action uniqueid="12008" event="script" value="allOutfits.lua"/>  -- Druid 
     <action uniqueid="12009" event="script" value="allOutfits.lua"/>  -- Wizard  
     <action uniqueid="12010" event="script" value="allOutfits.lua"/>  -- Oriental 
     <action uniqueid="12011" event="script" value="allOutfits.lua"/>  -- Pirate 
     <action uniqueid="12012" event="script" value="allOutfits.lua"/>  -- Assassin 
     <action uniqueid="12013" event="script" value="allOutfits.lua"/>  -- Beggar 
     <action uniqueid="12014" event="script" value="allOutfits.lua"/>  -- Shaman 
     <action uniqueid="12015" event="script" value="allOutfits.lua"/>  -- Norseman 
     <action uniqueid="12016" event="script" value="allOutfits.lua"/>  -- Knightmare 
     <action uniqueid="12017" event="script" value="allOutfits.lua"/>  -- Jester 
     <action uniqueid="12018" event="script" value="allOutfits.lua"/>  -- Brotherhood 
     <action uniqueid="12019" event="script" value="allOutfits.lua"/>  -- Demon Hunter 
     <action uniqueid="12020" event="script" value="allOutfits.lua"/>  -- Yalahari
Do data\actions\scripts tworzymy plik AllOutfits.lua i wklejamy do niego:
Kod:
 function onUse(cid, item, frompos, item2, topos)
         if item.uid == 12001 then
             if (getPlayerStorageValue(cid,12010) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Hunter Outfit!")
                doPlayerAddOutfitId(cid,2,0)
                setPlayerStorageValue(cid,12010,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Hunter Outfit.")
end
       elseif item.uid == 12002 then
              if (getPlayerStorageValue(cid,12011) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Mage Outfit!")
                doPlayerAddOutfitId(cid,3,0)
                setPlayerStorageValue(cid,12011,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Mage Outfit.")
end
       elseif item.uid == 12003 then
              if (getPlayerStorageValue(cid,12012) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Knight Outfit!")
                doPlayerAddOutfitId(cid,4,0)
                setPlayerStorageValue(cid,12012,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Knight Outfit.")
        end
    elseif item.uid == 12004 then
           if (getPlayerStorageValue(cid,12013) == -1) and getPlayerSex(cid) == 1 then
                doPlayerSendTextMessage(cid,21,"You now have the Nobleman Outfit!")
                doPlayerAddOutfitId(cid,5,0)
                setPlayerStorageValue(cid,12013,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
                else if(getPlayerStorageValue(cid,12013) == -1) and getPlayerSex(cid) == 0 then
                doPlayerSendTextMessage(cid,21,"You now have the Noblewoman Outfit!")
                doPlayerAddOutfitId(cid,5,0)
                setPlayerStorageValue(cid,12013,1)
        else
                doPlayerSendTextMessage(cid,25,"You Already have this outfit.")        
        end
           end
   elseif item.uid == 12005 then
        if (getPlayerStorageValue(cid,12014) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Summoner Outfit!")
                doPlayerAddOutfitId(cid,6,0)
                setPlayerStorageValue(cid,12014,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Summoner Outfit.")
        end
   elseif item.uid == 12006 then
          if (getPlayerStorageValue(cid,12015) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Warrior Outfit!")
                doPlayerAddOutfitId(cid,7,0)
                setPlayerStorageValue(cid,12015,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Warrior Outfit.")
        end
   elseif item.uid == 12007 then
          if (getPlayerStorageValue(cid,12016) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Barbarian Outfit!")
                doPlayerAddOutfitId(cid,8,0)
                setPlayerStorageValue(cid,12016,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Barbarian Outfit.")
        end
   elseif item.uid == 12008 then
          if (getPlayerStorageValue(cid,12017) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Druid Outfit!")
                doPlayerAddOutfitId(cid,9,0)
                setPlayerStorageValue(cid,12017,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Druid Outfit.")
        end
   elseif item.uid == 12009 then
          if (getPlayerStorageValue(cid,12018) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Wizard Outfit!")
                doPlayerAddOutfitId(cid,10,0)
                setPlayerStorageValue(cid,12018,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Wizard Outfit.")
        end
   elseif item.uid == 12010 then
          if (getPlayerStorageValue(cid,12019) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Oriental Outfit!")
                doPlayerAddOutfitId(cid,11,0)
                setPlayerStorageValue(cid,12019,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Oriental Outfit.")
        end
   elseif item.uid == 12011 then
          if (getPlayerStorageValue(cid,12020) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Pirate Outfit!")
                doPlayerAddOutfitId(cid,12,0)
                setPlayerStorageValue(cid,12020,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Pirate Outfit.")
        end
   elseif item.uid == 12012 then
          if (getPlayerStorageValue(cid,12021) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Assassin Outfit!")
                doPlayerAddOutfitId(cid,13,0)
                setPlayerStorageValue(cid,12021,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Assassin Outfit.")
        end
   elseif item.uid == 12013 then
          if (getPlayerStorageValue(cid,12022) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Beggar Outfit!")
                doPlayerAddOutfitId(cid,14,0)
                setPlayerStorageValue(cid,12022,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Beggar Outfit.")
        end
   elseif item.uid == 12014 then
          if (getPlayerStorageValue(cid,12023) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Shaman Outfit!")
                doPlayerAddOutfitId(cid,15,0)
                setPlayerStorageValue(cid,12023,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Shaman Outfit.")
        end
   elseif item.uid == 12015 then
           if (getPlayerStorageValue(cid,12024) == -1) and getPlayerSex(cid) == 1 then
                doPlayerSendTextMessage(cid,21,"You now have the Norseman Outfit!")
                doPlayerAddOutfitId(cid,16,0)
                setPlayerStorageValue(cid,12024,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
                else if(getPlayerStorageValue(cid,12024) == -1) and getPlayerSex(cid) == 0 then
                doPlayerSendTextMessage(cid,21,"You now have the Norsewoman Outfit!")
                doPlayerAddOutfitId(cid,16,0)
                setPlayerStorageValue(cid,12024,1)
        else
                doPlayerSendTextMessage(cid,25,"You Already have this outfit.")        
          end
           end
   elseif item.uid == 12016 then
          if (getPlayerStorageValue(cid,12025) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Knightmare Outfit!")
                doPlayerAddOutfitId(cid,17,0)
                setPlayerStorageValue(cid,12025,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Knightmare Outfit.")
        end
   elseif item.uid == 12017 then
          if (getPlayerStorageValue(cid,12026) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Jester Outfit!")
                doPlayerAddOutfitId(cid,18,0)
                setPlayerStorageValue(cid,12026,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Jester Outfit.")
        end
   elseif item.uid == 12018 then
          if (getPlayerStorageValue(cid,12027) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Brotherhood Outfit!")
                doPlayerAddOutfitId(cid,19,0)
                setPlayerStorageValue(cid,12027,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Brotherhood Outfit.")
        end
   elseif item.uid == 12019 then
          if (getPlayerStorageValue(cid,12028) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Demonhunter Outfit!")
                doPlayerAddOutfitId(cid,20,0)
                setPlayerStorageValue(cid,12028,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Demonhunter Outfit.")
        end
   elseif item.uid == 12020 then
          if (getPlayerStorageValue(cid,12029) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Yalahari Outfit!")
                doPlayerAddOutfitId(cid,21,0)
                setPlayerStorageValue(cid,12029,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Yalahari Outfit.")
        end
    end
        return TRUE
end
 

Our partners and their custom servers:

Odp: [8.*] Questy na outfity !!!

Edytujemy plik outfits.xml (zachowajcie kopie), kt?ry znajduje si? w data\XML na:
Kod:
<?xml version="1.0"?>
<outfits>
        <outfit id="1">
                <list gender="0" lookType="136" name="Citizen"/>
                <list gender="1" lookType="128" name="Citizen"/>
        </outfit>
        <outfit id="2" default="0">
                <list gender="0" lookType="137" name="Hunter"/>
                <list gender="1" lookType="129" name="Hunter"/>
        </outfit>
        <outfit id="3" default="0">
                <list gender="0" lookType="138" name="Mage"/>
                <list gender="1" lookType="130" name="Mage"/>
        </outfit>
        <outfit id="4" default="0">
                <list gender="0" lookType="139" name="Knight"/>
                <list gender="1" lookType="131" name="Knight"/>
        </outfit>
        <outfit id="5" premium="yes" default="0">
                <list gender="0" lookType="140" name="Noblewoman"/>
                <list gender="1" lookType="132" name="Nobleman"/>
        </outfit>
        <outfit id="6" premium="yes" default="0">
                <list gender="0" lookType="141" name="Summoner"/>
                <list gender="1" lookType="133" name="Summoner"/>
        </outfit>
        <outfit id="7" premium="yes" default="0">
                <list gender="0" lookType="142" name="Warrior"/>
                <list gender="1" lookType="134" name="Warrior"/>
        </outfit>
        <outfit id="8" premium="yes" default="0">
                <list gender="0" lookType="147" name="Barbarian"/>
                <list gender="1" lookType="143" name="Barbarian"/>
        </outfit>
        <outfit id="9" premium="yes" default="0">
                <list gender="0" lookType="148" name="Druid"/>
                <list gender="1" lookType="144" name="Druid"/>
        </outfit>
        <outfit id="10" premium="yes" default="0">
                <list gender="0" lookType="149" name="Wizard"/>
                <list gender="1" lookType="145" name="Wizard"/>
        </outfit>
        <outfit id="11" premium="yes" default="0">
                <list gender="0" lookType="150" name="Oriental"/>
                <list gender="1" lookType="146" name="Oriental"/>
        </outfit>
        <outfit id="12" premium="yes" default="0">
                <list gender="0" lookType="155" name="Pirate"/>
                <list gender="1" lookType="151" name="Pirate"/>
        </outfit>
        <outfit id="13" premium="yes" default="0">
                <list gender="0" lookType="156" name="Assassin"/>
                <list gender="1" lookType="152" name="Assassin"/>
        </outfit>
        <outfit id="14" premium="yes" default="0">
                <list gender="0" lookType="157" name="Beggar"/>
                <list gender="1" lookType="153" name="Beggar"/>
        </outfit>
        <outfit id="15" premium="yes" default="0">
                <list gender="0" lookType="158" name="Shaman"/>
                <list gender="1" lookType="154" name="Shaman"/>
        </outfit>
        <outfit id="16" premium="yes" default="0">
                <list gender="0" lookType="252" name="Norsewoman"/>
                <list gender="1" lookType="251" name="Norseman"/>
        </outfit>
        <outfit id="17" premium="yes" default="0">
                <list gender="0" lookType="269" name="Nightmare"/>
                <list gender="1" lookType="268" name="Nightmare"/>
        </outfit>
        <outfit id="18" premium="yes" default="0">
                <list gender="0" lookType="270" name="Jester"/>
                <list gender="1" lookType="273" name="Jester"/>
        </outfit>
        <outfit id="19" premium="yes" default="0">
                <list gender="0" lookType="279" name="Brotherhood"/>
                <list gender="1" lookType="278" name="Brotherhood"/>
        </outfit>
        <outfit id="20" premium="yes" default="0">
                <list gender="0" lookType="288" name="Demonhunter"/>
                <list gender="1" lookType="289" name="Demonhunter"/>
        </outfit>
        <outfit id="21" premium="yes" default="0">
                <list gender="0" lookType="324" name="Yalaharian"/>
                <list gender="1" lookType="325" name="Yalaharian"/>
        </outfit>
        <outfit id="22" access="5" premium="yes">
                <list gender="0-3" lookType="12" name="Archdemon"/>
        </outfit>
        <outfit id="23" access="5" premium="yes">
                <list gender="0-3" lookType="159" name="Elf"/>
        </outfit>
        <outfit id="24" access="5" premium="yes">
                <list gender="0-3" lookType="160" name="Dwarf"/>
        </outfit>
        <outfit id="25" access="5" premium="yes">
                <list gender="0-3" lookType="226" name="Frog"/>
        </outfit>
        <outfit id="26" access="5" premium="yes">
                <list gender="0-3" lookType="194" name="Cult"/>
        </outfit>
        <outfit id="27" access="5" premium="yes">
                <list gender="0-3" lookType="253" name="Headsplitter"/>
        </outfit>
        <outfit id="28" access="5" premium="yes">
                <list gender="0-3" lookType="254" name="Skullhunter"/>
        </outfit>
        <outfit id="29" access="5" premium="yes">
                <list gender="0-3" lookType="255" name="Bloodwalker"/>
        </outfit>
        <outfit id="30" access="5" premium="yes">
                <list gender="0-3" lookType="264" name="Brutetamer"/>
        </outfit>
        <outfit id="31" access="3" premium="yes">
                <list gender="2;3" lookType="75" name="Gamemaster"/>
        </outfit>
        <outfit id="32" access="4" premium="yes">
                <list gender="2;3" lookType="266" name="Community Manager"/>
        </outfit>
        <outfit id="33" access="5" premium="yes">
                <list gender="2;3" lookType="302" name="God"/>
        </outfit>
</outfits>

Ten scrypt jest rzadko spotykany, wi?c radz? wam dobrze poinformowa? o nim graczy, aby na pocz?tku gry nie uciekli wam stwierdzaj?c, ?e ots ma bugi i nawet outfitu nie mo?na wybra?...

PS szczerze nie wiem czy musicie edytowa? ten outfity.xml, ale chyba tak :).

Acha i zapomnia?em najwa?niejszego oczywi?cie - wyt?umaczy? to :).

A wi?c mamy linijk?:
Kod:
<action [COLOR="Olive"]uniqueid="12001"[/COLOR] event="script" value="allOutfits.lua"/>  -- Hunter
Stawiamy na mapie dowoln? skrzyni? czy d?wignie, czy cokolwiek innego i wpisujemy tam uniqueid kt?re w przypadku hunter outfit wynosi 12001 .

Po naci?ni?ciu, czy otworzeniu skrzyni dostajemy dany outfit i pojawia si? informacja, kt?r? mo?emy r?wnie? zmieni? na swoj?:
You now have the Demonhunter Outfit!
lub je?li ju? mamy outfit:
You Already have this outfit.

Stara?em si? wyt?umaczy? jak najlepiej mog?em :).
 
Ostatnia edycja:
Odp: [8.*] Questy na outfity !!!

no to tak:
Kod:
         if item.uid == 12001 then
             if (getPlayerStorageValue(cid,12010) == -1) then
                doPlayerSendTextMessage(cid,21,"You now have the Hunter Outfit!")
                doPlayerAddOutfitId(cid,2,0)
                setPlayerStorageValue(cid,12010,1)
                doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
        else
                doPlayerSendTextMessage(cid,25,"You Already have the Hunter Outfit.")
end
po co deklarujesz item.uid? skoro i tak w actions.xml musisz to napisac? bez sens..
nie wiem czy to zadziala bo NIE TESTUJE
[i dziala tak ze uzyjesz i daje all addony]:
Kod:
nie jestem pewnien ale outow jest chyba 20.. jak sie myle to napisz xd i poprawie
local config = {
looktypeoutfitowmale = {[1] = , [2] = , i tak do [20]= }, looktypeoutfitowfemale = {[1] = , [2] = , i tak do [20]= },
effekt = 19, jakistor = 45724,
}
function onUse(cid, item, frompos, item2, topos)
for i = 1, 20 do
if getPlayerStorageValue(cid, config.jakistor) == -1 then
if getPlayerSex(cid) == 1 then
doPlayerAddOutfit(cid,config.looktypeoutfitowmale[0+i] , 3)
doSendMagicEffect(getPlayerPosition(cid), config.effekt)
else
doPlayerAddOutfit(cid,config.looktypeoutfitowfemale [0+i] , 3)
doSendMagicEffect(getPlayerPosition(cid), config.effekt)
end
else
doPlayerSendTextMessage(cid,21,"You used it!")
end
end
end
taka alternatywa: P w sumie krotsze ale dziala troszke inaczej;] no i jeszcze raz mowie nie wiem czy dziala bo wszystko z pamieci pisze : P

co do tematu.. jak juz napisalem bez sensu deklarujesz uid bo to zbedne....

@Down
hmmmm moze i racja ale zobacz ze jakby to zrobic ze trzeba pokolei robic to byloby kul nie sadzisz?;]
Heh poraz 1 tak milo mnie potraktowales... musisz miec chyba dobry dzien : >

pozdrawiam
YoS
 
Ostatnia edycja:
Odp: [8.*] Questy na outfity !!!

Yos Ty jeste? zb?dny ;p Przeczytaj jego skrypt i b?dziesz wiedzia? dlaczego to nie jest zb?dne.Sam skrypt powinno oprze? si? na actionid a nie na uniqueid bo zmniejszy?oby to ilo?? deklaracja jak i sam skrypt by?by milion razy szybszy, potem Ci go poprawi?.
 
Odp: [8.*] Questy na outfity !!!

Omg no commento...
..::Brakuje citizena i tego z zao::..
Pisane pod TFS 0.3.6pl1


1. Tairens nie trawi? ci? id? pom?? ludziom na helpie to chocia? co? po?ytecznego zrobisz. Nie odpisuj bo mam ci? w nosie. I moje zachowanie to moje, a swoje komenty se zatrzymaj.

2. Yos no commento ;s jak kogo? poprawiasz to go popraw do ko?ca mo?e co ??

3. Nie testowane pisane z g?owy itp. Je?eli kto? chce by dzia?a?o szybciej (kosztem pami?ci) niech sobie zrobi z tablicy sta??.

Actions.xml
Kod:
<!--Outfit Quests -->
<!--12001 - Hunter, 12002 - Mage, 12003 - Knight, 12004 - Nobleman, 12005 - Summoner, 12006 - Warrior, 12007 - Barbarian , 12008 - Druid, 12009 - Wizard, 12010 - Oriental, 12011 - Oriental, 12012 - Assassin, 12013 - Beggar, 12014 - Shaman, 12015 - Norseman, 12016 - Knightmare, 12017 - Jester, 12018 - Brotherhood, 12019 - Demon Hunter, 12020 - Yalahari -->
<action fromuid="12001" touid="12020" script="allOutfits.lua" />


allOutfits.lua
Kod na wklejto.pl
Kod:
function onUse(cid, item, frompos, item2, topos)
      local Outfit = { 
                       [12001] = { Nr = {137,129}, Name = "Hunter"},           
                       [12002] = { Nr = {138,130}, Name = "Mage"},
                       [12003] = { Nr = {139,131}, Name = "Knight"},
                       [12004] = { Nr = {140,132}, Name = "Nobleman"},
                       [12005] = { Nr = {141,133}, Name = "Summoner"},
                       [12006] = { Nr = {142,134}, Name = "Warrior"},
                       [12007] = { Nr = {142,134}, Name = "Barbarian"},
                       [12008] = { Nr = {148,144}, Name = "Druid"},
                       [12009] = { Nr = {149,145}, Name = "Wizard"},
                       [12010] = { Nr = {150,146}, Name = "Oriental"},
                       [12011] = { Nr = {155,151}, Name = "Pirate"},
                       [12012] = { Nr = {156,152}, Name = "Assassin"},
                       [12013] = { Nr = {157,153}, Name = "Beggar"},
                       [12014] = { Nr = {158,154}, Name = "Shaman"},
                       [12015] = { Nr = {252,251}, Name = "Norseman"},
                       [12016] = { Nr = {269,268}, Name = "Knightmare"},
                       [12017] = { Nr = {270,273}, Name = "Jester"},
                       [12018] = { Nr = {279,278}, Name = "Brotherhood"},
                       [12019] = { Nr = {288,289}, Name = "Demon Hunter"},
                       [12020] = { Nr = {324,325}, Name = "Yalahari"}
                     }
	local Qu = Outfit[item.uid]
		if getPlayerStorageValue(cid, item.uid) == -1 then
		  doPlayerAddOutfit(cid, Qu.Nr[getPlayerSex(cid)], 3)
                  setPlayerStorageValue(cid, item.uid, 1)
                  doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))
                  doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, "You now have the " .. Qu.Name .. " Outfit!")
                  return true
            else
		  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
                  doPlayerSendCancel(cid, "You Already have the " .. Qu.Name .. " Outfit.")
            end
end


@up specjalnie dla ciebie jak by? si? dowali? :
Kod:
 1. Przyj??em uid takie jak kole? poda?, to samo z outami i innymi mega parametrami.
 2. Nie lubi? ci?.
 3. 1 warunek przykro mi mniej si? nie da.
 4. Zrobi?em nie potrzebn? zmienn? tak, Jednak je?eli lua jest inteligentne to wskazuje na adres pami?ci zadeklarowany przy tworzeniu tablicy nie na nowy adres z nowymi warto?ciami.
 5. Nom nie lubi? ci?.
 6. Zmie? sobie 2 s?owa i b?dziesz mia? action id.
 7. Tak bior? udzia? w konkursie.
 8. Bo?e jak ja nie trawie ci?...
 9. Jestem dysk debilem wara od mojej polszczyzny. 
10. Wszelkie b??dy zamierzone.
11. Nie nie dam fotki bo to nie m?j temat.
12. Je?eli uwa?asz ?e obrazi?em twoj? osob?, to gitara bo taki by? zamiar zrobi? to co ty robisz.
13. Czy mod nie powinien by? mi?y ? i nie mie? mniemania za wysokiego o sobie ??
14. Nie wiem ju? do czego mo?esz si? przyczepi?.

@Ciekawe ile warn?w dostane za udowadnianie komu? ?e nie ma racji..

@PS2. Poprawa skryptu (zamiana 2 liniijek miejscami)Orygina? na wklejce zostawi?em
 
Ostatnia edycja:
Odp: [8.*] Questy na outfity !!!

Okej, nie musz? by? dla nikogo mi?y. Skrypt ju? nie pierwszy raz skopa?e?;-) Mo?esz mnie nie trawi?, nie ma problemu, jednak dop?ki mi nie udowodnisz mojej s?abo?ci b?d? poprawia? ka?dego kogo mi si? ?ywnie podoba ;)

Tutaj masz kod na zach?t?, ?eby? zobaczy? jak nale?y pisa? skrypty:
Kod:
local Outfit = 
{ 
	[12001] = { Nr = {137,129}, Name = "Hunter"},           
	[12002] = { Nr = {138,130}, Name = "Mage"},
	[12003] = { Nr = {139,131}, Name = "Knight"},
	[12004] = { Nr = {140,132}, Name = "Nobleman"},
	[12005] = { Nr = {141,133}, Name = "Summoner"},
	[12006] = { Nr = {142,134}, Name = "Warrior"},
	[12007] = { Nr = {142,134}, Name = "Barbarian"},
	[12008] = { Nr = {148,144}, Name = "Druid"},
	[12009] = { Nr = {149,145}, Name = "Wizard"},
	[12010] = { Nr = {150,146}, Name = "Oriental"},
	[12011] = { Nr = {155,151}, Name = "Pirate"},
	[12012] = { Nr = {156,152}, Name = "Assassin"},
	[12013] = { Nr = {157,153}, Name = "Beggar"},
	[12014] = { Nr = {158,154}, Name = "Shaman"},
	[12015] = { Nr = {252,251}, Name = "Norseman"},
	[12016] = { Nr = {269,268}, Name = "Knightmare"},
	[12017] = { Nr = {270,273}, Name = "Jester"},
	[12018] = { Nr = {279,278}, Name = "Brotherhood"},
	[12019] = { Nr = {288,289}, Name = "Demon Hunter"},
	[12020] = { Nr = {324,325}, Name = "Yalahari"}
}

function onUse(cid, item, frompos, item2, topos)
	local actuallOutfit = Outfit[item.actionid]
	if(actuallOutfit == nil) then
		return true
	end
	local effect = CONST_ME_POFF
	local text = "You already have the " .. actuallOutfit.Name .. " Outfit."
	if(getPlayerStorageValue(cid, (item.actionid * 100)) == -1) then
		for i = 1, 2 do
			doPlayerAddOutfit(cid, actuallOutfit.Nr[i], 3)
		end
		setPlayerStorageValue(cid, (item.actionid * 100), 1)
		effect = math.random(1, 67)
		text = "You now have the " .. actuallOutfit.Name .. " Outfit!"
	end
	doPlayerSendTextMessage(cid, 22,text)
	doSendMagicEffect(getCreaturePosition(cid), effect)
return true
end
 
Ostatnia edycja:
Odp: [8.*] Questy na outfity !!!

fakt przyznam racje to co ja napisalem nie mialo sensu.. ale Wy tez popelniliscie swego rodzaju gafe..
Kod:
effect = math.random(1, 67)
jak sadzicie czy efekt 67 jest na tibi np 8.0? bo jak widac w temcie WYRAZNIE jest napisane 8.* wiec teoretycznie jakbym chcial to odpalic na tibii 8.1 to bylby blad;] bo efekt 67 jest dopiero od +8.5;]

2:1 dla Was... (grrr><)

@topic
w sumie reasumujac.. bardzo fajny skrypt xd
 
Odp: [8.*] Questy na outfity !!!

W sumie to zadzia?a tylko na tfs 0.3.4+ Tibia 8.4+.
Ale to ma?y szczeg??, ja osobi?cie wol? star? wersje w C++. Je?eli kto? ma strarsz? wersje forgotena i nie ma tej funckjii ten temat powinien mu pom?c:
Jak dla mnie jest o tyle ciekawiej ?e operujemy storage co u?atwia robienie quest?w zwi?zanych na przyk?ad z NPC.


Ot, tyle doda?em od siebie. Skryptu nie chce komentowa? poniewa? nie ma takiej potrzeby. Je?eli dzia?a znaczy ?e jest dobrym skryptem, nie jest wa?ne jak dzia?a.
 
Odp: [8.*] Questy na outfity !!!

Ja mam takie male pytanie bo chce zrobic ze po kliknieciu w jakis kamyk/lub cos innego dostaje sie outfit i np do tego 1 addon ...Ktos by mogl dla mnie przerobic/zrobic taki skrypt.bo bardzo mi na tym zalezy..
A co do tego skryptu to tez mi sie przyda..
 
Status
Zamknięty.
Back
Do góry Bottom