• logo_cipsoft
    Nowe serwery zostały otwarte 19 Lut 2025:
    Noctalia (Open PvP) Ignitera (Open PvP) us_logo Xybra (Open PvP)

[8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Status
Zamknięty.

Archimonde

Suple!
Dołączył
Sierpień 18, 2008
Posty
1215
Liczba reakcji
259
Witam mam taki problem ustawi?em sobie NPC kt?ry sprzedaje aol runy poty i poty i sd w bp lecz kiedy pisze trade otwiera si? i zamyka okno trade odrazu i mam takie pytanie czy da sie to jako? zrobi? ?eby mo?na by?o kupywa? runy i potiony w bp na 8.22?/
Drugie pytanie to jak zrobi? npc z addonami kt?ry by sprzedawa? pierwszy addon za 50k a drugi za 20k pr?bowa?em podmieni? npc z EVO lecz niestety nie wysz?o mi to i npc si? wog?le nie pojawia na mapie.
Trzecie pytanie jak zrobi? npc na statku kt?ry nas by przewozi? z miasta do miasta czy z wyspy do
wyspy.

a i mam jeszcze jedno pytanie wie ktos jak wklejac do mapy cos z innejmapy?
 
Ostatnia edycja:
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Co do mapy:

Otwierasz dwa mapeditory, w jednym t? mapk? do kt?rej chcesz wklei?, a w drugim t? mapk? z kt?rej chcesz co? wyci??. Nast?pnie w tym mapeditorze z kt?rego chcesz wyci?? klikasz taki kwadracik jak w paincie, zaznaczasz co chcesz wyci?? klikasz PPM* i copy. Teraz przechodzisz do mapeditora do kt?rego chcesz wklei?i po prostu PPM* pase.

*Gdzie PPM = prawy przycisk myszy.
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Odpowiem na pytanie ostatnie.Otwierasz jeden map editor z jedn? mapk? i bierzesz narz?dzie zaznacz obszar.Wtedy zaznaczasz ten obszar i robisz "kopiuj".Nast?pnie otwierasz drugi map editor (ten pierwszy zostawiasz w spokoju !) i wczytujesz t? mapk? do kt?rej chcesz wrzuci? dane obiekty z tej pierwszej.I bierzesz narz?dzie zaznacz obszar i bierzesz wklej.

My?l? ?e pomog?em ... Pozdro.
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Co do mapy:
Otwierasz dwa mapeditory, w jednym t? mapk? do kt?rej chcesz wklei?, a w drugim t? mapk? z kt?rej chcesz co? wyci??. Nast?pnie w tym mapeditorze z kt?rego chcesz wyci?? klikasz taki kwadracik jak w paincie, zaznaczasz co chcesz wyci?? klikasz PPM* i copy. Teraz przechodzisz do mapeditora do kt?rego chcesz wklei?i po prostu PPM* pase.
*Gdzie PPM = prawy przycisk myszy.


w RME taki trick nie przejdzie; )
trzeba skopiowac czesc mapy, w??czyc nowa mape i dopiero wtedy kopiowa?
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Mam pytanie a gdzie jest ten guzik w RME 1.0.8 bo ja go nie widze nigdzie...
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Musisz przytrzyma? Shift (lewy) i zaznaczasz.

Pozdrawiam,
Shadow.
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Dolanczam sie do prosby z tymi addonami do 8.22 -> Dokladnie chodzi o to ?e 50k za 1 addon to 1 outfitu a nie do ka?dego "np. first hunter addon"

Z G?ry Wielkie Dzi?ki :*
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Kod:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
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 buyAddons(cid, message, keywords, parameters, node)
	--TODO: buyAddons function in modules.lua
	if(not npcHandler:isFocused(cid)) then
		return false
	end
	local addon = parameters.addon
	local cost = parameters.cost
	local premium = (parameters.premium ~= nil and parameters.premium)
	if isPlayerPremiumCallback == nil or (isPlayerPremiumCallback(cid) and premium) then
		if doPlayerRemoveMoney(cid, cost) == TRUE then
			doPlayerAddAddons(cid, addon)
			npcHandler:say('There, you are now able to use all addons!', cid)
		else
			npcHandler:say('Sorry, you do not have enough money.', cid)
		end
	else
		npcHandler:say('I only serve customers with premium accounts.', cid)
	end
	keywordHandler:moveUp(1)
	return true
end
local node1 = keywordHandler:addKeyword({'first addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first addons set for 50000 gold coins?'})
	node1:addChildKeyword({'yes'}, buyAddons, {addon = 1, cost = 50000, premium = true})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})
local node2 = keywordHandler:addKeyword({'second addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to buy the second addons set for 20000 gold coins?'})
	node2:addChildKeyword({'yes'}, buyAddons, {addon = 2, cost = 20000, premium = true})
	node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})
keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell the first addons set for 50000 gold coins and the second addons set for 20000 gold coins.'})
npcHandler:addModule(FocusModule:new())
Pozdrawiam,
Shadow.

@down
Eh... tak to si? czyta 0 znak?w interpunkcyjnych w dodatku b??dy ortograficzne.
 
Ostatnia edycja:
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Shadow im chodzi o to zeby mozna kupic kazdy addon osobno :P np 'first barbarian addon' 'second citizen addon' etc, A przynajmniej tak wnioskuje z tego co napisal ziemba193 :d


PHP:
local keywordHandler = KeywordHandler:new() 
local npcHandler = NpcHandler:new(keywordHandler) 
NpcSystem.parseParameters(npcHandler) 


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 

npcHandler:setMessage(MESSAGE_GREET, "Greetings |PLAYERNAME|. Will you help me? If you do, I'll reward you with nice addons! Just say {addons} or {help} if you don't know what to do.") 

function playerBuyAddonNPC(cid, message, keywords, parameters, node) 
    if(not npcHandler:isFocused(cid)) then 
        return false 
    end 
    if (parameters.confirm ~= true) and (parameters.decline ~= true) then 
        if(getPlayerPremiumDays(cid) == 0) and (parameters.premium == true) then 
            npcHandler:say('Sorry, but this addon is only for premium players!', cid) 
            npcHandler:resetNpc() 
            return true 
        end 
        if (getPlayerStorageValue(cid, parameters.storageID) ~= -1) then 
            npcHandler:say('You already have this addon!', cid) 
            npcHandler:resetNpc() 
            return true 
        end 
        local itemsTable = parameters.items 
        local items_list = '' 
        if table.maxn(itemsTable) > 0 then 
            for i = 1, table.maxn(itemsTable) do 
                local item = itemsTable[i] 
                items_list = items_list .. item[2] .. ' ' .. getItemName(item[1]) 
                if i ~= table.maxn(itemsTable) then 
                    items_list = items_list .. ', ' 
                end 
            end 
        end 
        local text = '' 
        if (parameters.cost > 0) and #parameters.items > 0 then 
            text = items_list .. ' and ' .. parameters.cost .. ' gp' 
        elseif (parameters.cost > 0) then 
            text = parameters.cost .. ' gp' 
        elseif #parameters.items > 0 then 
            text = items_list 
        end 
        npcHandler:say('Did you bring me ' .. text .. ' for ' .. keywords[1] .. '?', cid) 
        return true 
    elseif (parameters.confirm == true) then 
        local addonNode = node:getParent() 
        local addoninfo = addonNode:getParameters() 
        local items_number = 0 
        if #addoninfo.items > 0 then 
            for i = 1, #addoninfo.items do 
                local item = addoninfo.items[i] 
                if (getPlayerItemCount(cid,item[1]) >= item[2]) then 
                    items_number = items_number + 1 
                end 
            end 
        end 
        if(getPlayerMoney(cid) >= addoninfo.cost) and (items_number == #addoninfo.items) then 
            doPlayerRemoveMoney(cid, addoninfo.cost) 
            if table.maxn(addoninfo.items) > 0 then 
                for i = 1, table.maxn(addoninfo.items) do 
                    local item = addoninfo.items[i] 
                    doPlayerRemoveItem(cid,item[1],item[2]) 
                end 
            end 
            doPlayerAddOutfit(cid, addoninfo.outfit_male, addoninfo.addon) 
            doPlayerAddOutfit(cid, addoninfo.outfit_female, addoninfo.addon) 
            setPlayerStorageValue(cid,addoninfo.storageID,1) 
            npcHandler:say('Here you are.', cid) 
        else 
            npcHandler:say('You do not have addon rune, u can buy it in sms shop!', cid) 
        end 
        npcHandler:resetNpc() 
        return true 
    elseif (parameters.decline == true) then 
        npcHandler:say('Not interested? Maybe other addon?', cid) 
        npcHandler:resetNpc() 
        return true 
    end 
    return false 
end 

local noNode = KeywordNode:new({'no'}, playerBuyAddonNPC, {decline = true}) 
local yesNode = KeywordNode:new({'yes'}, playerBuyAddonNPC, {confirm = true}) 

local outfit_node = keywordHandler:addKeyword({'first citizen addon'}, playerBuyAddonNPC, {premium = true, cost = 50000, items = 0, outfit_female = 136, outfit_male = 128, addon = 1, storageID = 10001}) 
    outfit_node:addChildKeywordNode(yesNode) 
    outfit_node:addChildKeywordNode(noNode) 
local outfit_node = keywordHandler:addKeyword({'second citizen addon'}, playerBuyAddonNPC, {premium = true, cost = 50000, items = 0, outfit_female = 136, outfit_male = 128, addon = 2, storageID = 10002}) 
    outfit_node:addChildKeywordNode(yesNode) 
    outfit_node:addChildKeywordNode(noNode) 


keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can give you Citizen,  addons.'}) 
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To buy the first addon say \'first NAME addon\', for the second addon say \'second NAME addon\'.'}) 

npcHandler:addModule(FocusModule:new())

to jest przyklad

A tu Shadow dal tego npcka w calosci wiec sobie przer?bcie jak tam chcecie (po 50k kazdy) i juz ;]

 
Ostatnia edycja:
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Wielkie dzieki Matre oto wlasnie mi chodzilo :) Jeden kt?ry umie dobrze czytac :* xDD
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

no ok npc od addon?w mam ale czy wie ktos albo zna jaki? poradnik do robienia npc na statkach albo jak zrobi? ?eby npc sprzedawa? runy i manaski w bp w systemie Trade
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Skrypt do boat:
Kod:
local keywordHandler = KeywordHandler:new()
        local npcHandler = NpcHandler:new(keywordHandler)
        NpcSystem.parseParameters(npcHandler)
        -- OTServ event handling functions start
        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
        -- OTServ event handling functions end
        -- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
        local travelNode = keywordHandler:addKeyword({'miasto'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do You want to travel to miasto for 100 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=0, y=0, z=0} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Bye then!'})      
        -- Makes sure the npc reacts when you say hi, bye etc.
        npcHandler:addModule(FocusModule:new())
Musisz wpisa? kordy oraz nazw? miasta. Je?eli chcesz ?eby wysy?a? do paru miejsc musisz po prostu dodawa? kolejne:
Kod:
        local travelNode = keywordHandler:addKeyword({'miasto2'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do You want to travel to miasto2 for 100 gold?'})
            travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=0, y=0, z=0} })
            travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Bye then!'})
Pozdrawiam,
Shadow.
 
Odp: [8.22]TFS 0.3a2-console Statek,Addony,Bp sd u npc

Wielkie dzi?ki je?eli mo?esz to zamknij temat

/Zamykam.
 
Ostatnio edytowane przez moderatora:
Status
Zamknięty.
Do góry