Ir para conteúdo

kwovan

Campones
  • Total de itens

    27
  • Registro em

  • Última visita

Posts postados por kwovan

  1. Se for mais de uma moeda mude:

     

    doPlayerRemoveItem(cid, 9971)

     

    para

     

    doPlayerRemoveItem(cid, 9971,quantidade)

     

    function onSay(cid, words, param)
    if(words == "!buyvip") then
    local moeda = nome da moeda
    if doPlayerRemoveItem(cid, 9971) == TRUE then
    local days = 15
    local daysvalue = days * 24 * 60 * 60
    local storageplayer = getPlayerStorageValue(cid, 13540)
    local timenow = os.time()
    
    if getPlayerStorageValue(cid, 13540) - os.time() <= 0 then
    time = timenow + daysvalue
    else
    time = storageplayer + daysvalue
    end
    
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de VIP no seu character.")
    setPlayerStorageValue(cid, 13540, time)
    
    local quantity = math.floor((getPlayerStorageValue(cid, 13540) - timenow)/(24 * 60 * 60))
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você tem ".. quantity .." dias de VIP restantes.")
    else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você precisa de uma "..moeda.." para colocar vip.")
    end
    

  2. Tem esse script aqui, não testei.

     

    function onSay(cid, words, param)
    config = {
    dias=30,
    itemname=vipcoin,
    moeda=1000
    }
    
    if doRemoveItem(uid, config.moeda) then
    doPlayerAddPremiumDays(cid, config.dias)
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
    else
    doPlayerSendCancel(cid, "You not have ".. config.itemname ..".")
    doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    return true
    end
    end

     

    Tem esse aqui também, vai em mods/buypremium_command.xml e bota isso:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <mod name="Buy premium command" version="1.0" author="The Forgotten Server" contact="otland.net" enabled="yes">
    <config name="buypremium_config"><![CDATA[
    	config = {
    		days = 30,
    		itemid = 1000,
                           itemname = vipcoin,
    		maxDays = 360
    	}
    ]]></config>
    <talkaction words="!buypremium; !pacc" event="buffer"><![CDATA[
    	domodlib('buypremium_config')
    	if(getPlayerPremiumDays(cid) > config.maxDays) then
    		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You can not buy more than " .. config.days + config.maxDays .. " days of Premium Account.")
    		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    		return
    	end
    
    	if(not doRemoveItem(uid, config.itemid)) then
    		doPlayerSendCancel(cid, "You don't have " .. config.itemname .. ".")
    		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
    		return
    	end
    
    	doPlayerAddPremiumDays(cid, config.days)
    	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have bought " .. config.days .. " days of premium account.")
    ]]></talkaction>
    </mod>

  3. na pasta do OT>data>items>items.xml

    procure o item e veja algo assim

    <item id="2197" article="a" name="stone skin amulet">
    <attribute key="weight" value="760" />
    <attribute key="slotType" value="necklace" />
    <attribute key="showcharges" value="1" />
    <attribute key="absorbPercentPhysical" value="80" />
    <attribute key="absorbPercentDeath" value="80" />
    <attribute key="showattributes" value="1" />

    Nesta linha fica as cargas

    <attribute key="showcharges" value="1" />

    Provavelmente é aqui...

    se for outro erro, que pode ser eu não sei...

     

    Nessa linha fica se vai aparecer as charges ou não.

     

    <item id="2197" article="a" name="stone skin amulet">
    	<attribute key="weight" value="760" />
    	<attribute key="slotType" value="necklace" />
    	<attribute key="charges" value="5" />
    	<attribute key="showcharges" value="1" />
    	<attribute key="absorbPercentPhysical" value="80" />
    	<attribute key="absorbPercentDeath" value="80" />
    	<attribute key="showattributes" value="1" />
    </item>
    

  4. Alguns servidores não possui o sistema de quest, aquele que você só coloca o ID do item no baú e ja ta pronta a quest.

     

    Em data/actions/actions.xml adicione essa tag:

     

    <action itemid="1740;1747;1748;1749;1770" script="quest_system.lua"/>
    

     

    Em data/actions/scripts crie um arquivo com o nome quest_system.lua:

     

    function onUse(cid, item, frompos, item2, topos)
           prize = item.uid
           count = item.actionid
    
           if prize > 0 and prize < 9000 then
                   queststatus = getPlayerStorageValue(cid,prize)
    
                   if queststatus == -1 then
                           if count > 1 then
                                   doPlayerSendTextMessage(cid,22,'You have found '.. count ..' of ' .. getItemName(prize) .. '.')
                                   doPlayerAddItem(cid,prize,count)
                                   setPlayerStorageValue(cid,prize,1)    
                           else
                                   doPlayerSendTextMessage(cid,22,'You have found a ' .. getItemName(prize) .. '.')
                                   doPlayerAddItem(cid,prize,1)
                                   setPlayerStorageValue(cid,prize,1)      
                           end
                   else
                           doPlayerSendTextMessage(cid,22,"It is empty.")
                   end
    
                   return 1
           else
                   return 0
           end
    end
    

  5. Em data/npc crie um arquivo chamado A Sweaty Cyclops.xml:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <npc name="A Sweaty Cyclops" script="data/npc/scripts/A Sweaty Cyclops.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
    <look type="22" head="0" body="0" legs="0" feet="0" addons="0"/>
    <parameters>
           <parameter key="message_greet" value="Hum Humm! Welcume lil' Player.."/>
           <parameter key="message_farewell" value="Good bye lil' one."/>
       </parameters>
    </npc>
    

     

    Em data/npc/scripts crie um arquivo chamado A Sweaty Cyclops.lua:

     

    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
    --returns how many msgs he have said already
    function cancelNPCTalk(events)
     local ret=1
     for aux=1,table.getn(events) do
        if events[aux].done==FALSE then
           stopEvent(events[aux].event)
        else
           ret=ret+1
        end
     end
     events=nil
     return(ret)
    end
    
    function doCreatureSayWithDelay(cid,text,type,delay,e)
      if delay<=0 then
         doCreatureSay(cid,text,type)
      else
         local func=function(pars)
                       doCreatureSay(pars.cid,pars.text,pars.type)
                       pars.e.done=TRUE
                    end
         e.done=FALSE
         e.event=addEvent(func,delay,{cid=cid, text=text, type=type, e=e})
      end
    end
    
    function doNPCTalkALot(msgs,interval)
     local e={}
     local ret={}
     if interval==nil then interval=3000 end --3 seconds is default time between messages
     for aux=1,table.getn(msgs) do
         e[aux]={}
         doCreatureSayWithDelay(getNpcCid(),msgs[aux],TALKTYPE_PRIVATE_NP,(aux-1)*interval,e[aux])
         table.insert(ret,e[aux])
     end
     return(ret)
    end
    --end shit 
    
    
    
    
    
    function creatureSayCallback(cid, type, msg)
       if(not npcHandler:isFocused(cid)) then
           return false
       end      
    -- zmienne lokalne
      local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
       local namee = getPlayerName(cid)
    local tabelka = {
                   [1] = {wypowiedz = 'job', odpowiedz = 'I am smith.'},
                   [2] = {wypowiedz = 'smith', odpowiedz = 'Working steel is my profession.'},
                   [3] = {wypowiedz = 'steel', odpowiedz = 'Manny kinds of. Like {Mesh Kaha Rogh}, {Za\'Kalortith}, {Uth\'Byth}, {Uth\'Morc}, {Uth\'Amon}, {Uth\'Maer}, {Uth\'Doon}, and {Zatragil}.'},
                   [4] = {wypowiedz = 'zatragil', odpowiedz = 'Most ancients use dream silver for different stuff. Now ancients most gone. Most not know about.'},
                   [5] = {wypowiedz = 'uth\'doon', odpowiedz = 'It\'s high steel called. Only lil\' lil\' ones know how make.'},
                   [6] = {wypowiedz = 'za\'kalortith', odpowiedz = 'It\'s evil. Demon iron is. No good cyclops goes where you can find and need evil flame to melt.'},
                   [7] = {wypowiedz = 'mesh kaha rogh', odpowiedz = 'Steel that is singing when forged. No one knows where find today.'},
                   [8] = {wypowiedz = 'ab\'dendriel', odpowiedz = 'Me parents live here before town was. Me not care about lil\' ones.'},
                   [9] = {wypowiedz = 'lil\i lil\'', odpowiedz = 'Lil\' lil\' ones are so fun. We often chat. '},
                   [10] = {wypowiedz = 'tibia', odpowiedz = 'One day I\'ll go and look. '},
                   [11] = {wypowiedz = 'teshial', odpowiedz = 'Is one of elven family or such thing. Me not understand lil\' ones and their busisness.'},
                   [12] = {wypowiedz = 'cenath', odpowiedz = 'Is one of elven family or such thing. Me not understand lil\' ones and their busisness.'},
                   [13] = {wypowiedz = 'name', odpowiedz = 'I called Bencthyclthrtrprr by me people. Lil\' ones me call Big Ben.'},
                   [14] = {wypowiedz = 'god', odpowiedz = 'You shut up. Me not want to hear.'},
    			-- Wymiana items 1 --
                   [15] = {wypowiedz = 'uth\'lokr', odpowiedz = 'Firy steel it is. Need green ones\' breath to melt. Or red even better. Me can make from shield. Lil\' one want to trade?', storage_wym = no, talk_give = yes, talk_jaki = 1},
    			[16] = {wypowiedz = 'uth\'kean', odpowiedz = 'Very noble. Shiny. Me like. But breaks so fast. Me can make from shiny armour. Lil\' one want to trade?', talk_give = yes, talk_jaki = 2},
    			[17] = {wypowiedz = 'za\'ralator', odpowiedz = 'Hellsteel is. Cursed and evil. Dangerous to work with. Me can make from evil helmet. Lil\' one want to trade?', talk_give = yes, talk_jaki = 3},
    			[18] = {wypowiedz = 'uth\'prta', odpowiedz = 'Good iron is. Me friends use it much for fight. Me can make from weapon. Lil\' one want to trade?', talk_give = yes, talk_jaki = 4},
    			[18] = {wypowiedz = 'soul orb', odpowiedz = 'Uh. Me can make some nasty lil\' bolt from soul orbs. Lil\' one want to trade all?', talk_give = yes, talk_jaki = 5},
    			[19] = {wypowiedz = 'amulet', odpowiedz = 'Hum Humm! Welcume lil. Me can do unbroken but Big Ben want gold 5000 and Big Ben need a lil time to make it unbroken. Yes or no??', talk_give = yes, talk_jaki = 6},
    			[20] = {wypowiedz = 'gear wheel', odpowiedz ='Hmmm you want to change your iron ore to gear wheel?', odpowiedzZla = 'Only for persons whose start the quest of beregar city..', storage_wym = yes, storage_jaki = 72182, storage_nr = 2, talk_give = yes, talk_jaki = 7},
    			[21] = {wypowiedz = 'bast skirt', odpowiedz = 'Lil\' one bring three bast skirts?', talk_give = yes, talk_jaki = 9},
    			-- Forge --
    			[22] = {wypowiedz = 'forge', odpowiedz = 'Me can forge equipment back to steel. Like {Za\'Ralator}, {Uth\'Kean}, {Uth\'Lokr}, {Uth\'Prta}'},
    			-- Wymiana items 2 --
    			}
    local tabela2 = {
                   [1] = {wypowiedz = 'yes', talk_wym = yes, talk_jaki = 1, item1 = 2516, item2 = 5889, item1_count = 1, item2_count = 1},
    			[2] = {wypowiedz = 'yes', talk_wym = yes, talk_jaki = 2, item1 = 2487, item2 = 5887, item1_count = 1, item2_count = 1},
    			[3] = {wypowiedz = 'yes', talk_wym = yes, talk_jaki = 3, item1 = 2462, item2 = 5888, item1_count = 1, item2_count = 1},
    			[4] = {wypowiedz = 'yes', talk_wym = yes, talk_jaki = 4, item1 = 2393, item2 = 5892, item1_count = 1, item2_count = 1},
    			[5] = {wypowiedz = 'yes', talk_wym = yes, talk_jaki = 5, item1 = 5944, item2 = 6529, item1_count = 1, item2_count = 2},
                   [6] = {wypowiedz = 'yes', talk_wym = yes, talk_jaki = 7, item1 = 5880, item2 = 9690, item1_count = 1, item2_count = 1, storage_wym = yes, storage_jaki = 72182, storage_nr = 2},
    			}
    		local questStg = 8239
    		local questStg_nr = 2
    		local questLog = 98203
    for i=1, #tabelka do
       if msgcontains(msg, tabelka[i].wypowiedz) then
             selfSay(tabelka[i].odpowiedz, cid)
        if tabelka[i].talk_give == yes then
    	  talkState[talkUser] = tabelka[i].talk_jaki
    	end
    
       end
    
    end
    for i=1, #tabela2 do	
       if msgcontains(msg, tabela2[i].wypowiedz) then
       if getPlayerStorageValue(cid, questStg) >= questStg_nr then
          if talkState[talkUser] == tabela2[i].talk_jaki and doPlayerTakeItem(cid, tabela2[i].item1, tabela2[i].item1_count) then
          doPlayerAddItem(cid, tabela2[i].item2, tabela2[i].item2_count)
             selfSay('Cling Clang', cid)
          elseif getPlayerStorageValue(cid, questStg) >= questStg_nr and talkState[talkUser] == tabela2[i].talk_jaki and doPlayerTakeItem(cid, tabela2[i].item1, tabela2[i].item1_count) == FALSE then
          selfSay('You haven\'t got enough items for trade.', cid)
          end
       end
       if talkState[talkUser] == 9 and getPlayerStorageValue(cid, questStg) == 1 and doPlayerTakeItem(cid, 3983, 3) == TRUE then
       selfSay('Good good! Woman happy will be. Now me happy too and help you.', cid)
       setPlayerStorageValue(cid, questStg, 2)
       elseif talkState[talkUser] == 9 and getPlayerStorageValue(cid, questStg) == 1 and doPlayerTakeItem(cid, 3983, 3) == FALSE then
       selfSay('You haven\'t got 3 bast skirts ', cid)
          elseif getPlayerStorageValue(cid, questStg) < 1 and talkState[talkUser] == tabela2[i].talk_jaki then	   
       selfSay('Wait. Me work no cheap is. Do favour for me first, yes?', cid)
       talkState[talkUser] = 8
    
       elseif getPlayerStorageValue(cid, questStg) < 1 and talkState[talkUser] == 8 then
       selfSay('Me need gift for woman. We dance, so me want to give her bast skirt. But she big is. So I need many to make big one. Bring three okay? Me wait.', cid)
       setPlayerStorageValue(cid, questStg, 1)
       setPlayerStorageValue(cid, questLog, 1)
          end
       end
    
    end 
    return true
    end
    npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
    npcHandler:addModule(FocusModule:new())
    

     

    Em data/xml/quests.xml adicione isto:

     

    <quests>
       <quest name="Friends and Traders" startstorageid="98203" startstoragevalue="0">
        <mission name="The Sweaty Cyclops" storageid="8239" startvalue="0" endvalue="2">
    	   <missionstate id="1" description="Bring to Sweaty Cyclops 3 bast skirts, for his girlfriend."/>
    	   <missionstate id="2" description="Big Ben, the cyclops in Ab'Dendriel will help you to forge different steel now. Just ask him if you need something."/>
    	</mission>
       </quest>
    </quests>
    

     

    Créditos: Seminari

  6. Testado no TFS 0.4 e 0.3.6pl1

     

    Ache as fuções e modifique.

     

    container.cpp

     

    Cylinder* Container::__queryDestination(int32_t& index, const Thing* thing, Item** destItem, uint32_t&)
    {
    if(index == 254 /*move up*/)
    {
    	index = INDEX_WHEREEVER;
    	*destItem = NULL;
    
    	Container* parentContainer = dynamic_cast<Container*>(getParent());
    	if(parentContainer)
    		return parentContainer;
    
    	return this;
    }
    else if(index == 255 /*add wherever*/){
    	index = INDEX_WHEREEVER;
    	*destItem = NULL;
    }
    else if(index >= (int32_t)capacity()){
    		/*
    		if you have a container, maximize it to show all 20 slots
    		then you open a bag that is inside the container you will have a bag with 8 slots
    		and a "grey" area where the other 12 slots where from the container
    		if you drop the item on that grey area
    		the client calculates the slot position as if the bag has 20 slots
    		*/
    		index = INDEX_WHEREEVER;
    	*destItem = NULL;
    }
    
    const Item* item = thing->getItem();
    if(item == NULL){
    	return this;
    }
    
    if(item->isStackable()){
    	if(item->getParent() != this){
    		//try find a suitable item to stack with
    		uint32_t n = 0;
    		for(ItemList::iterator cit = itemlist.begin(); cit != itemlist.end(); ++cit){
    			if((*cit) != item && (*cit)->getID() == item->getID() && (*cit)->getItemCount() < 100){
    				*destItem = (*cit);
    				index = n;
    				return this;
    			}
    
    			++n;
    		}
    	}
    }
    
    if(index != INDEX_WHEREEVER){
    	Thing* destThing = __getThing(index);
    	if(destThing)
    		*destItem = destThing->getItem();
    
    	Cylinder* subCylinder = dynamic_cast<Cylinder*>(*destItem);
    
    	if(subCylinder){
    		index = INDEX_WHEREEVER;
    		*destItem = NULL;
    		return subCylinder;
    	}
    }
    
    return this;
    }
    

     

    item.cpp

     

    void Item::setDefaultSubtype()
    {
    setItemCount(1);
    const ItemType& it = items[id];
    if(it.charges)
    	setCharges(it.charges);
    }
    

     

    player.cpp

     

    Cylinder* Player::__queryDestination(int32_t& index, const Thing* thing, Item** destItem,
    uint32_t& flags)
    {
    if(index == 0 /*drop to capacity window*/ || index == INDEX_WHEREEVER){
    	*destItem = NULL;
    
    	const Item* item = thing->getItem();
    	if(item == NULL){
    		return this;
    	}
    
    	//find an appropiate slot
    	std::list<Container*> containerList;
    	for(int i = SLOT_FIRST; i < SLOT_LAST; ++i){
    		Item* inventoryItem = inventory[i];
    
    		if(inventoryItem == tradeItem){
    			continue;
    		}
    
    		if(inventoryItem == tradeItem){
    			continue;
    		}
    
    			if(inventoryItem){
    				//try find an already existing item to stack with
    			if(inventoryItem != item && item->isStackable() && inventoryItem->getID() == item->getID() && inventoryItem->getItemCount() < 100){
    				*destItem = inventoryItem;
    				index = i;
    				return this;
    			}
    			//check sub-containers
    			else if(Container* subContainer = inventoryItem->getContainer()){
    				Cylinder* tmpCylinder = NULL;
    				int32_t tmpIndex = INDEX_WHEREEVER;
    				Item* tmpDestItem = NULL;
    
    				tmpCylinder = subContainer->__queryDestination(tmpIndex, item, &tmpDestItem, flags);
    				if(tmpCylinder && tmpCylinder->__queryAdd(tmpIndex, item, item->getItemCount(), flags) == RET_NOERROR){
    					index = tmpIndex;
    					*destItem = tmpDestItem;
    					return tmpCylinder;
    				}
    
    				containerList.push_back(subContainer);
    			}
    		}
    		//empty slot
    		else if(__queryAdd(i, item, item->getItemCount(), flags) == RET_NOERROR){
    			index = i;
    			*destItem = NULL;
    			return this;
    		}
    	}
    
    	//check deeper in the containers
    	for(std::list<Container*>::iterator it = containerList.begin(); it != containerList.end(); ++it){
    		for(ContainerIterator iit = (*it)->begin(); iit != (*it)->end(); ++iit){
    			if(Container* subContainer = (*iit)->getContainer()){
    
    				if(subContainer == tradeItem){
    					continue;
    				}
    
    				Cylinder* tmpCylinder = NULL;
    				int32_t tmpIndex = INDEX_WHEREEVER;
    				Item* tmpDestItem = NULL;
    
    				tmpCylinder = subContainer->__queryDestination(tmpIndex, item, &tmpDestItem, flags);
    				if(tmpCylinder && tmpCylinder->__queryAdd(tmpIndex, item, item->getItemCount(), flags) == RET_NOERROR){
    					index = tmpIndex;
    					*destItem = tmpDestItem;
    					return tmpCylinder;
    				}
    			}
    		}
    	}
    	return this;
    }
    
    Thing* destThing = __getThing(index);
    if(destThing)
    	*destItem = destThing->getItem();
    
    Cylinder* subCylinder = dynamic_cast<Cylinder*>(destThing);
    
    if(subCylinder){
    	index = INDEX_WHEREEVER;
    	*destItem = NULL;
    	return subCylinder;
    }
    else
    	return this;
    }
    

     

    Créditos: Exedion

  7. Testado no TFS 0.3.6pl1.

     

    Vá até game.cpp e procure por:

     

    	return false;
    }
    
    if (specialVip && !player->hasFlag(PlayerFlag_SpecialVIP))
    {
    	player->sendTextMessage(MSG_STATUS_SMALL, "You cannot add this player.");
    	return false;
    }
    
    bool online = false;
    

     

    Mude para:

     

    	return false;
    }
    
    if((specialVip && !player->hasFlag(PlayerFlag_SpecialVIP)) || (player->getAccess() < 3 && getPlayerByName(name)->getAccess() >= 3))
    {
    	player->sendTextMessage(MSG_STATUS_SMALL, "You cannot add this player.");
    	return false;
    }
    
    bool online = false;
    

     

    Créditos: Antharaz

  8.  

    Também procure:

    void ProtocolGame::sendCancelTarget()
    {
    NetworkMessage_ptr msg = getOutputBuffer();
    if(msg)
    {
    TRACK_MESSAGE(msg);
    msg->AddByte(0xA3);
    }
    }

     

    Substitua por:

    void ProtocolGame::sendCancelTarget()
    {
    NetworkMessage_ptr msg = getOutputBuffer();
    if(msg)
    {
    TRACK_MESSAGE(msg);
    msg->AddByte(0xA3);
    msg->AddU32(0);
    }
    }

     

    da pra arruma o bug do target follow com isso no 8.54 - 8.57 ?

     

    Nem sei se existe nessas versão, mais creio que da para arrumar.

  9. Aquelas bordas ali de grass fica melhor na terra.

     

    Aquelas 'tábuas' apoiando na parede, são escadas.

     

    E aquela casa ali de baixo < \/, coloque uma cerca, não aquelas paredinhas.

     

    Nature muito ruim.

     

    Leia alguns tutoriais.

     

    Boa sorte!

  • Quem Está Navegando   0 membros estão online

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