What's new

Creaturescripts Skrypt na sagi

Status
Not open for further replies.

Rarzillo De Bonzo

Senior User
Joined
Apr 10, 2009
Messages
726
Reaction score
27
Jako ,?e dzisiaj poprawi?em skrypt na sagi i dzia?a on na takiej zasadzie ,?e ka?da osoba ,kt?ra zada min. 25% hp lub ostatni hit dostaje sage.

W data/Creaturescript/creaturescript.xml dodajemy:



Code:
<event type="kill" name="saga" event="script" value="saga.lua"/>

W Creaturescirpt/sripts/login.lua
Code:
registerCreatureEvent(cid, "saga")


W Creaturescirpt/sripts/Saga.lua
Code:
function onKill(cid, target, lastHit)
	if lastHit and getCreatureName(target):lower() == 'wolf' or getCreatureName(target):lower() == 'wolf' and doCreatureAddHealth(target, -(getCreatureHealth(target)*(25/100))) then
		setGlobalStorageValue(1, 0)
		doCreatureSay(cid, "You kill mizuki", TALKTYPE_ORANGE_1)
		if getPlayerStorageValue(cid, 8000) == 1 then
			setPlayerStorageValue(cid, 8000, 2)
		end
	end
	return true
end

Skrypt dzia?a na tfs 0.3.5 pl, wiem bo testowa?em xd. W miejsce wolf nale?y wpisa? nazw? potworka ,kt?ry daje nam storage.

25/100<----ile % hp trzeba zada? potworkowi aby?my otrzymali sage.

Je?eli kto? chce to mo?e da? + xd.

Screen dla potwierdzenie. Kolega zjecha? go do reda a ja dobi?em mobka i oboje dostali?my storage ;d.
sagak.png


Zabraniam kopiowania zawarto?ci na inne fora/serwisy.
 

lordmarian

Advanced User
Joined
May 26, 2009
Messages
366
Reaction score
19
Odp: Skrypt na sagi

Zajebiste ka?demu sie przyda amsz tam tego plusa czy co to jest :D
 

SanninStory

https://www.twitch.tv/sdrn
Joined
Oct 13, 2012
Messages
1,778
Reaction score
119
Odp: Skrypt na sagi

Wydaje mi si?, aby Saga mia?a sens, powinno podczepi? si? do tego Skryptu:


Wtedy nie tylko mo?na zabija? potwory ale tak?e rozmawia? z NPC itp.

Pozdrawiam.
 

Rarzillo De Bonzo

Senior User
Joined
Apr 10, 2009
Messages
726
Reaction score
27
Odp: Skrypt na sagi

Oceni kto? jeszcze xd?

@down
Ty pacanie, mi chodzi tylko o ocen? skryptu. To m?j 3 czy tam 4 skrypt od 0 ,wi?c cicho. Zreszt? napisa?em
Code:
Je?eli kto? chce to mo?e da? + xd.
. Czytaj uwa?niej, mi zale?y tylko na ocenie.
 
Last edited:

Rarzillo De Bonzo

Senior User
Joined
Apr 10, 2009
Messages
726
Reaction score
27
Odp: Skrypt na sagi

Aby zrobi? taki efekt ,?e mo?ecie bi? w niego to c++ lub lua (creaturescript , combat)
 

Ruby Shark

Advanced User
Joined
Feb 6, 2010
Messages
325
Reaction score
16
Odp: Skrypt na sagi

Da? bys rade zrobic tabele ? :D
w sesie ze :
[getstorage] [value] = wolf = [setstorage] [value],
[getstorage] [value] = monk = [setstorage] [value],
[getstorage] [value] = rat = [setstorage] [value]

itd ?:D
 

Nosfera

Advanced User
Joined
Jul 4, 2012
Messages
291
Reaction score
14
Odp: Skrypt na sagi

Hmmm no przyda si?, zmodyfikowa? trzeba nieco, no ale dzi?ki.
 

triedge

Advanced User
Joined
Sep 8, 2009
Messages
341
Reaction score
21
Age
31
Odp: Skrypt na sagi

Tak, tabela napewno by by?a lepszym rozwi?zaniem ! Czekam..
 

Rarzillo De Bonzo

Senior User
Joined
Apr 10, 2009
Messages
726
Reaction score
27
Odp: Skrypt na sagi

Nie chce mi si? robi? tabeli ;d. Cieszcie si? z tego co jest ;d. Nied?ugo wrzuc? czar ;d
 

Jokerguy

User
Joined
Feb 19, 2013
Messages
10
Reaction score
1
Odp: Skrypt na sagi

PHP:
local table = {
	['wolf'] = {get = 1, set = 2},
	['wolf kozak'] = {get = 2, set = 3}
}

function onKill(cid, target, lastHit)
local var = table[getCreatureName(target):lower()]
	if(lastHit and var) then
		doCreatureSay(cid, "You killed ".. var, TALKTYPE_ORANGE_1)
		if getPlayerStorageValue(cid, 8000) == var.get then
			setPlayerStorageValue(cid, 8000, var.set)
		end
	end
	return true
end

Nietestowane.
 

Kazik Flo

Advanced User
Joined
Jun 6, 2010
Messages
216
Reaction score
8
Odp: Skrypt na sagi

Siemka mi si? przyda?o za ch?ci masz repa + pozdrawiam ; D
 
Status
Not open for further replies.
Top