• 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!

Lua Make an item attack?

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,775
Solutions
25
Reaction score
483
Location
Sweden
Is it possible to make an item attack Players? (by script)

In my case, ID: 1560 to attack like this:

Lua:
  <attacks>
    <attack name="melee" interval="2000" skill="1" attack="1"/>
    <attack name="poison" interval="1000" chance="100" range="7" min="-50" max="-100">
      <attribute key="shootEffect" value="energy"/>
      <attribute key="areaEffect" value="yellowspark"/>
    </attack>
  </attacks>
 
it's possible in many ways. but which of them do you want?
item that you can pick up, but when it's on ground it attacks you/players?

item that cannot be picked up and attacks you/players?

or what exactly?
 
PHP:
function onSay(cid, words, param, channel)
	playerVocation = getPlayerVocation(cid)
	RequiredVocation = VOCNUM
	TargetCid = getCreatureTarget(cid)
	if playerVocation ~= RequiredVocation then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Wrong Vocation")
	return true
	end

	if TargetCid == 0 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Attack someone")
	return true
	end
	
	HealthToRemove = 500
	
	--Remove Health
	doCreatureAddHealth(TargetCid, -HealthToRemove)
	return true
end
Edit vocnum to the vocation number.
1= Sorc
2= Druid
3= Pally
4= Knight
5=master sorc
6=elder druid
7=royal pally
8=elite knight

Credits to: rockseller
 
ehhhh that is not nearly what he's asking for.... he spoke of an item, that is a talkaction.
 
Last edited:
it's possible in many ways. but which of them do you want?
item that you can pick up, but when it's on ground it attacks you/players?

item that cannot be picked up and attacks you/players?

or what exactly?

Well, an item of 1560 (It's an Obelisk) It's not able to pick up or move.
 
No it's an item as far as I know. I talked to a guy named Kratos, in 7.6 client it's not even possible to hide the monsters name (and in a cam from that time the magichthrowers didn't have names) :p + there are stuff (hangables) on the walls that shoots as well, would be tricky to set a monster on a wall :p
 
yes but what you mean with shoot???

the only way i could think of is to create an addEvent that is executed e.g. each 500ms or something (depending on how fast you want it to attack) and then by that it should choose the target and attack it with give combats ??

does that sound like something?? if so I could make it... if 7.6 one has addEvent anyway.......
 
Well I'm not sure what you mean Colandus. I only can answer that it should attack as a magicthrower (same attack speed as monsters?) and I showed how in the first post :p
 
Looooooooooooooooooooooooolllllllllllllllllllllll!!!!!!!!!

just make a monster and give him outfit like an item?


edit: didn't saw page 2.

Anyway, who says it's impossible to hide names in 7.6? easy like eatin cake
 
Kratos, he says it ain't possible due to something with the client. I don't know, I tried ripping an attribute (hidename/health) from 7.92 sources, though with less success than that I hoped for
 
Back
Top