Kilka pyta? na temat otsa :) [8.1][SQL,OTBM, LUA]

Status
Zamknięty.

Hopyz

User
Zarejestrowany
Dołączył
Kwiecień 4, 2008
Posty
39
Liczba reakcji
7
Witajcie, bez owijania w bawe?ne:

1) Jak zrobi? w SQL aby doda? itemki do postaci a tak?e ustawi? kto ma by? tutorem czy gmem [poniewa? w xml jest zak?adka acces a na sql takiej oto nie widze -.-]

2) Jak zrobi? aby przy starcie w ?wi?tyni sta?y skrzynie i ?eby by?o mo?na wzi??c z nich dan? itemke.

3) Potrzebuje o skrypt aby doda? do npca ?eby sprzedawa? kryszta?ki do enchatntowania broni

4)Jak skopiowa? miasto z jednej mapy na dr?g? map? ?

Z g?ry dzi?kuje...
 
Ja znam odpowiedz do 4:):).Musisz zaznaczyc teren kt?ry chcesz skopiowac klikno? ctrl+c potem owozyc 2 map edytora i klikamy ctrl+v aby wklejc
 
Ad 1.
W phpmyadmin w tabeli "players" masz co? takiego:
group_id: wpisujesz tu numerek grupy ( dla GoD'a jest to oczywi?cie 5. )

Ad 2.
Musisz utworzy? quest ( jak go zrobi? to ju? musisz poszuka? na forum, chyba ?e nie ma to zaraz napisz? taki artyku? )

Ad 3.
Tu niestety Ci nie pomog? bo nie znam takiego npc'a

Ad 4.
Tak jak kolega wy?ej napisa?
Zaznaczasz miasto, nast?pnie kombinacja crtl + c, potem w drugim map edytorze crtl + v

Pozdrawiam
 
3.)


skrypt nazwijmy sobie enchnpc.lua
Kod:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

  	if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
  		selfSay('Welcome, ' .. creatureGetName(cid) .. '! I sell magic gems to enchanted your weapons: terra gem, enerdy gem, ice gem and fire gem. Only gems costs 10.000 gp.')
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I tocking to your friend now. Please wait.')

	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'terra gem') then
			buy(cid,2149,getCount(msg),10000)
		elseif msgcontains(msg, 'ice gem') then
			buy(cid,2150,getCount(msg),10000)
		elseif msgcontains(msg, 'energy gem') then
			buy(cid,2146,getCount(msg),10000)
		elseif msgcontains(msg, 'fire gem') then
			buy(cid,2147,getCount(msg),10000)

		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
	end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next...')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Bye.')
 			focus = 0
 		end
 	end
end

Bez owijania w bawe?n?, prosz? ;)
 
@wavus
zle mnie zrozumia?es
dzi?kuje za ten skrypt, ale szukam tylko frafment skryptu kt?ry wkleje do npceta od backpackow etc... a pozatym nie chcia?em gem?w tylko small sapphier small rubbin itd..

@kilka up

mam rme map editor a tam to inaczej sie jakos robi =/
 
2. odpowied?

2. odpowied?

2. - W mapeditorze postaw skrzynie i chyba w uniqid czy jako? tak musisz wpisa? id itemka.
 
Otwierasz npc'a co sella bp w notatniku i w odpowiednim miejscu wpisujesz :

elseif msgcontains(msg, 'fire gem') then
buy(cid,2147,getCount(msg),10000)



Co trzeba napisa? aby to kupi?
ID tego co chesz ?eby si? kupi?o
Ile pieni?dzy potrzeba aby to kupi?
 
do 1) lepiej jakby? wstawi? 6 zamiast 5 :p na niekt?rych ots`ach God to 6
 
apropo skopiowania miasta
najlepszym rozwiazaniem bedzie opcja import w RME :)
naciskasz import i kopiuje ci wszystko poziomy
 
Ehh... pomoc :)

Ehh... pomoc :)

Ujm? to tak: te "Gemy" to kryszta?y (small ruby, saphire itd) do enchantu broni.
Wysil si? i zobacz na id "gem?w"...

//Ww-a

Wklej do NPC sprzedaj?cego backpack's to:

if msgcontains(msg, 'terra gem') then
buy(cid,2149,getCount(msg),10000)
elseif msgcontains(msg, 'ice gem') then
buy(cid,2150,getCount(msg),10000)
elseif msgcontains(msg, 'energy gem') then
buy(cid,2146,getCount(msg),10000)
elseif msgcontains(msg, 'fire gem') then
buy(cid,2147,getCount(msg),10000)
 
Status
Zamknięty.
Back
Do góry