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

How to make special description for loot item ?

pioncz

New Member
Joined
Dec 3, 2008
Messages
149
Reaction score
1
Hi,
Same like in thread. How to make that ? I tried to make text="" and description="" but it dont work. Some body can help ?
 
darkhaos I will rep you but please tell how to use that script.
And how about key charges ?
 
Last edited:
And how to use ? OnKill or what ?

darkhaos I will rep you but please tell how to use that script.
And how about key charges ?

Lua:
  local loot = doCreatureSepDropLoot(uid, itemid)
doSetItemSpecialDescription(loot, "text")

Replace "itemid" for the ID of the item you want to get a special description.

Example:(Amulet of Loss)

Lua:
  local loot = doCreatureSepDropLoot(uid, 2173)
doSetItemSpecialDescription(loot, "Saves your life.")

I believe you need to use it in this way:

actions.xml (for aol)

Code:
<action itemid="2173" event="script" value="scriptname.lua"/>

and save this, as script.lua

Lua:
  local loot = doCreatureSepDropLoot(uid, 2173)
doSetItemSpecialDescription(loot, "Saves your life.")

Got it? :eek:
 
I thought actions work when we use items, not when monster drops. In creature script's is too much code to write. Maybe is easyer way ? Maybe change some functions ? I guess. Please help.
 
Maybe
Code:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	doSetItemSpecialDescription(corpse.uid, "Text")
	return TRUE
end

remember to declare it also in creaturescripts.xml and login.lua! ;)
 
I was traying that :
Code:
function onUse(cid, item, frompos, item2, toPosition)
  local loot = doCreatureSepDropLoot(cid, 2088)
doSetItemSpecialDescription(loot, "Saves your life.")
end
and not working.
 
I was traying that :
Code:
function onUse(cid, item, frompos, item2, toPosition)
  local loot = doCreatureSepDropLoot(cid, 2088)
doSetItemSpecialDescription(loot, "Saves your life.")
end
and not working.

Did you put the movements?

and it is not "doCreatureSepDropLoot" but doCreatureSetDropLoot.
 
create a lua script in creatureScripts and put this:

Lua:
function onKill(cid, target)
local creature = "Demon"

	if getCreatureName(target) == creature and isMonster(target) then
		local loot = doCreatureSetDropLoot(target, 2195) --boots of haste
		doSetItemSpecialDescription(loot, "Demon Boots of Haste")
	end
	return TRUE
end

Put this in creaturescripts.xml:
Lua:
<event type="kill" name="Loot" event="script" value="SCRIPT_NAME.lua"/>

Add this in login.lua
Lua:
registerCreatureEvent(cid, "Loot")

Later, add this in the monster-file (in this case, in demon.xml)
After </flags> add:
Lua:
<script>
<event name="Loot"/>
</script>

That's all

@Kekox!

You're right! my bad! xD fast writing
 
My bug
Code:
[16/05/2009 11:19:15] [Error - CreatureEvent::configureEvent] No valid type for creature event.textedit
[16/05/2009 11:19:15] [Warning - BaseEvents::loadFromXml] Can not configure event
 
create a lua script in creatureScripts and put this:

Lua:
function onKill(cid, target)
local creature = "Demon"

	if getCreatureName(target) == creature and isMonster(target) then
		local loot = doCreatureSetDropLoot(target, 2195) --boots of haste
		doSetItemSpecialDescription(loot, "Demon Boots of Haste")
	end
	return TRUE
end

Put this in creaturescripts.xml:
Lua:
<event type="kill" name="Loot" event="script" value="SCRIPT_NAME.lua"/>

Add this in login.lua
Lua:
registerCreatureEvent(cid, "Loot")

Later, add this in the monster-file (in this case, in demon.xml)
After </flags> add:
Lua:
<script>
<event name="Loot"/>
</script>

That's all

@Kekox!

You're right! my bad! xD fast writing

Don't work, any errors. And descriptions not set. Testes 0.3.4 TFS
 
Back
Top