Summoning Horn
Posted: Sun Mar 08, 2015 8:07 pm
Search the asset pack for files that contain the text "Horn of Summoning"Emera Nova wrote:So I'm wanting to do stuff with the summoning horn much like they did in the main game with bringing out the enemy on the beach using it. How would I need to set up a script to have it call an enemy or create an item if you are standing somewhere.
Code: Select all
defineObject{
name = "horn",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/horn.fbx",
},
{
class = "Item",
uiName = "Horn of Summoning",
gfxIndex = 297,
weight = 1.0,
primaryAction = "blow",
description = "This horn has a pungent earthy smell.",
},
{
class = "ItemAction",
name = "blow",
uiName = "Blow Horn",
cooldown = 4,
onAttack = function(self)
for e in party.map:entitiesAt(party.x, party.y) do
if e.script and e.script.blowTheHorn then
e.script:blowTheHorn()
end
end
playSound("blow_horn")
end,
},
},
}Code: Select all
onAttack = function(self)
for e in party.map:entitiesAt(party.x, party.y) do
if e.script and e.script.blowTheHorn then
e.script:blowTheHorn()
endNot sure if I understand your question.Daniknamchang wrote:I'm new to programing and wanted the same thing.
I understand how the code for the horn works but I'm confused on how you get the horn in the map in the first place.