• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TalkAction Weapon Attack Editing

I r New

New Member
Joined
Feb 1, 2008
Messages
137
Reaction score
1
I need a script that will edit the attack of a
Code:
Dagger [2379].
when it is in your hand, this has to be for GM only.

So I would have to say /editatack "number of attack

so if I have a Dagger in my hand and I say "editattack "1000000" I look at the dagger and should say
Code:
23:12 You see a dagger (Atk:1000000, Def:6).
It weighs 9.50 oz.
 
only in 0.3betas

/attr name "item name" description "item description" attack 5 defense 5 attackspeed 1000

It will make item named "item name" with description "item description", with attack 5 and defense 5 and it will attack 1 time a second. If you don't want to use all of possibilities just don't use them and don't write them.

for example.
/attr attack 1000

NOTE! You have to stand in front of the item!

You can make it with EVERY ITEM.

Additional things to change are:
description
count
action
unique
duration
writer
text
name
article
attack
extraattack
defense
extradefense
armor
attackspeed
hitchance
shootrange

those are the most important

to more advanced ppl:
you can also change values in CREATURES! yes, players and perhaps monsters with /attr. More commands you will find in talkaction.cpp, 519+line
 
Last edited:
only in 0.3betas

/attr name "item name" description "item description" attack 5 defense 5 attackspeed 1000

It will make item named "item name" with description "item description", with attack 5 and defense 5 and it will attack 1 time a second. If you don't want to use all of possibilities just don't use them and don't write them.

for example.
/attr attack 1000

NOTE! You have to stand in front of the item!

You can make it with EVERY ITEM.

Additional things to change are:
description
count
action
unique
duration
writer
text
name
article
attack
extraattack
defense
extradefense
armor
attackspeed
hitchance
shootrange

those are the most important

to more advanced ppl:
you can also change values in CREATURES! yes, players and perhaps monsters with /attr. More commands you will find in talkaction.cpp, 519+line

vocation, mana, health, maxmana, maxhealth, skull, guildnick, group and i dont remember others...

that function is so cool =)
 
Use
Code:
[COLOR="Blue"]setItemAttack[COLOR="DarkGreen"]([/COLOR]uid[COLOR="DarkGreen"],[/COLOR] attack[COLOR="DarkGreen"])[/COLOR][/COLOR]

Example

Code:
[COLOR="Blue"]item = doPlayerAddItem[COLOR="DarkGreen"]([/COLOR]cid[COLOR="DarkGreen"],[/COLOR] [COLOR="DarkGreen"]2432[/COLOR][COLOR="DarkGreen"],1)[/COLOR] --fire axe
setItemAttack[COLOR="DarkGreen"](item, 100)[/COLOR][/COLOR]
 
@up
He wanted it with a command ^^, anyways, I have to look in source, those functions are interesting :D
 
So.. your gonna make the talkaction? coz I want it badly >.< I saw one on a server whenever a GOD put a Knife in his hand it gave it what ever attack he did mostly it was just random numbers lol
 
I'll just do this

Use
Code:
[COLOR="Blue"]setItemAttack[COLOR="DarkGreen"]([/COLOR]uid[COLOR="DarkGreen"],[/COLOR] attack[COLOR="DarkGreen"])[/COLOR][/COLOR]

Example

Code:
[COLOR="Blue"]item = doPlayerAddItem[COLOR="DarkGreen"]([/COLOR]cid[COLOR="DarkGreen"],[/COLOR] [COLOR="DarkGreen"]2432[/COLOR][COLOR="DarkGreen"],1)[/COLOR] --fire axe
setItemAttack[COLOR="DarkGreen"](item, 100)[/COLOR][/COLOR]

I'll just use this and I'll change the ID but can someone show me how to make it last for a certain ammount of time? xD
 
Try this....

Code:
[COLOR="Blue"]function onSay(cid, words, param)
	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
		return TRUE
	end

	local t = string.explode(param, ",")
	local tmp = t[1]
	if(t[2]) then
		tmp = t[2]
	end

	local id = tonumber(t[1])
	if(not id) then
		id = getItemNameById(t[1])
		if(id == LUA_ERROR) then
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item wich such name does not exists.")
			return TRUE
		end
	end

	t[1] = tonumber(t[1])
	if(t[1] > 0 and t[1] < 10017) then
	local weapon = doPlayerAddItem(cid, t[1], 1)
		setItemAttack(weapon, tmp)
		doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED)
else
	doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Item ID has to be between 1 and 10016")

		return TRUE
	end
end[/COLOR]

Example: /attack 2390, 120
itemID 2390: Magic longsword
 
Argh

Code:
[20/01/2009  12:10:17] Lua Script Error: [TalkAction Interface] 
[20/01/2009  12:10:17] data/talkactions/scripts/attack.lua:onSay

[20/01/2009  12:10:17] data/talkactions/scripts/attack.lua:7: attempt to call field 'explode' (a nil value)
[20/01/2009  12:10:17] stack traceback:
[20/01/2009  12:10:17] 	data/talkactions/scripts/attack.lua:7: in function <data/talkactions/scripts/attack.lua:1>

:( damn lol xD I really wanted this. umm can u make me one thats just for one item and u say !rage or something and the attack of your weapon increases by about 200 for 60 secs, thats a lot easier ;p
 
Code:
[20/01/2009  12:10:17] Lua Script Error: [TalkAction Interface] 
[20/01/2009  12:10:17] data/talkactions/scripts/attack.lua:onSay

[20/01/2009  12:10:17] data/talkactions/scripts/attack.lua:7: attempt to call field 'explode' (a nil value)
[20/01/2009  12:10:17] stack traceback:
[20/01/2009  12:10:17] 	data/talkactions/scripts/attack.lua:7: in function <data/talkactions/scripts/attack.lua:1>

:( damn lol xD I really wanted this. umm can u make me one thats just for one item and u say !rage or something and the attack of your weapon increases by about 200 for 60 secs, thats a lot easier ;p

You need that functions to make it works ;)
http://otland.net/f163/string-explode-your-talkactions-6761/
 
Back
Top