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

Help Creature Scripts (Revscriptsys)

adrenysny

Member
Joined
Feb 17, 2021
Messages
140
Reaction score
14
Hello I would like someone to help me make a revscripts that is a monster event.

When killing the monster "Wild Knowledge", its body turns into this item "13122" and it has this ActionID "4951"

Note: it is believed where the monster dies

OPEN PHOTO
|
V
 

Attachments

Solution
Tested on 1.3

ezgif.com-gif-maker(3).gif

Add this to the XML file.
XML:
<script>
    <event name="WildKnowledgeDeath" />
</script>
data/scripts/creaturescripts/wildKnowledgeDeath.lua
Lua:
local config = {
    vortexId = 13122,
    vortexAid = 4951,
    time = 10 -- seconds
}

local function removeVortex(position)
    local tile = Tile(position)
    local vortex = tile:getItemById(config.vortexId)
    if not vortex then
        return
    end
    vortex:remove()
    position:sendMagicEffect(CONST_ME_POFF)
end

local creatureevent = CreatureEvent("WildKnowledgeDeath")
function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if corpse then
        corpse:remove()
    end...
Tested on 1.3

ezgif.com-gif-maker(3).gif

Add this to the XML file.
XML:
<script>
    <event name="WildKnowledgeDeath" />
</script>
data/scripts/creaturescripts/wildKnowledgeDeath.lua
Lua:
local config = {
    vortexId = 13122,
    vortexAid = 4951,
    time = 10 -- seconds
}

local function removeVortex(position)
    local tile = Tile(position)
    local vortex = tile:getItemById(config.vortexId)
    if not vortex then
        return
    end
    vortex:remove()
    position:sendMagicEffect(CONST_ME_POFF)
end

local creatureevent = CreatureEvent("WildKnowledgeDeath")
function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if corpse then
        corpse:remove()
    end 
    creature:say("The vortex has opened! Enter before it collapses.", TALKTYPE_MONSTER_SAY)
    local vortex = Game.createItem(config.vortexId, 1, creature:getPosition())
    vortex:setActionId(config.vortexAid)
    addEvent(removeVortex, config.time * 1000, creature:getPosition())
    return true
end
creatureevent:register()
 
Solution
Tested on 1.3

View attachment 57054

Add this to the XML file.
XML:
<script>
    <event name="WildKnowledgeDeath" />
</script>
data/scripts/creaturescripts/wildKnowledgeDeath.lua
Lua:
local config = {
    vortexId = 13122,
    vortexAid = 4951,
    time = 10 -- seconds
}

local function removeVortex(position)
    local tile = Tile(position)
    local vortex = tile:getItemById(config.vortexId)
    if not vortex then
        return
    end
    vortex:remove()
    position:sendMagicEffect(CONST_ME_POFF)
end

local creatureevent = CreatureEvent("WildKnowledgeDeath")
function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if corpse then
        corpse:remove()
    end
    creature:say("The vortex has opened! Enter before it collapses.", TALKTYPE_MONSTER_SAY)
    local vortex = Game.createItem(config.vortexId, 1, creature:getPosition())
    vortex:setActionId(config.vortexAid)
    addEvent(removeVortex, config.time * 1000, creature:getPosition())
    return true
end
creatureevent:register()
 

Attachments

Lua:
local mType = Game.createMonsterType("Wild Knowledge")
local monster = {}

monster.description = "a wild knowledge"
monster.experience = 0
monster.outfit = {
    lookType = 293,
    lookHead = 0,
    lookBody = 0,
    lookLegs = 0,
    lookFeet = 0,
    lookAddons = 0,
    lookMount = 0
}
monster.events = {
    "WildKnowledgeDeath",
}
monster.health = 2000
monster.maxHealth = 2000
monster.corpse = 0
monster.speed = 50
monster.manaCost = 0
monster.maxSummons = 0

monster.changeTarget = {
    interval = 5000,
    chance = 8
}

monster.strategiesTarget = {
    nearest = 100,
}

monster.flags = {
    summonable = false,
    attackable = true,
    hostile = true,
    convinceable = false,
    pushable = false,
    rewardBoss = false,
    illusionable = false,
    canPushItems = true,
    canPushCreatures = true,
    staticAttackChance = 90,
    targetDistance = 1,
    runHealth = 0,
    healthHidden = false,
    isBlockable = false,
    canWalkOnEnergy = false,
    canWalkOnFire = false,
    canWalkOnPoison = false,
    pet = false
}

monster.light = {
    level = 0,
    color = 0
}

monster.voices = {
    interval = 5000,
    chance = 10,
}

monster.loot = {
}

monster.attacks = {
    {name ="melee", interval = 2000, chance = 100, minDamage = 0, maxDamage = -200},
    {name ="combat", interval = 1000, chance = 25, type = COMBAT_ENERGYDAMAGE, minDamage = 0, maxDamage = -705, shootEffect = CONST_ANI_ENERGYBALL, target = false}
}

monster.defenses = {
    defense = 33,
    armor = 28
}

monster.elements = {
    {type = COMBAT_PHYSICALDAMAGE, percent = 0},
    {type = COMBAT_ENERGYDAMAGE, percent = 0},
    {type = COMBAT_EARTHDAMAGE, percent = 0},
    {type = COMBAT_FIREDAMAGE, percent = 0},
    {type = COMBAT_LIFEDRAIN, percent = 0},
    {type = COMBAT_MANADRAIN, percent = 0},
    {type = COMBAT_DROWNDAMAGE, percent = 0},
    {type = COMBAT_ICEDAMAGE, percent = 0},
    {type = COMBAT_HOLYDAMAGE , percent = 0},
    {type = COMBAT_DEATHDAMAGE , percent = 0}
}

monster.immunities = {
    {type = "paralyze", condition = false},
    {type = "outfit", condition = false},
    {type = "invisible", condition = true},
    {type = "bleed", condition = false}
}

mType:register(monster)





Code:
local config = {
    vortexId = 13122,
    vortexAid = 4951,
    time = 10 -- seconds
}

local function removeVortex(position)
    local tile = Tile(position)
    local vortex = tile:getItemById(config.vortexId)
    if not vortex then
        return
    end
    vortex:remove()
    position:sendMagicEffect(CONST_ME_POFF)
end

local creatureevent = CreatureEvent("WildKnowledgeDeath")
function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if corpse then
        print(type(corpse))
    end
    creature:say("The vortex has opened! Enter before it collapses.", TALKTYPE_MONSTER_SAY)
    local vortex = Game.createItem(config.vortexId, 1, creature:getPosition())
    vortex:setActionId(config.vortexAid)
    addEvent(removeVortex, config.time * 1000, creature:getPosition())
    return true
end
creatureevent:register()
Post automatically merged:

Tested on 1.3

View attachment 57054

Add this to the XML file.
XML:
<script>
    <event name="WildKnowledgeDeath" />
</script>
data/scripts/creaturescripts/wildKnowledgeDeath.lua
Lua:
local config = {
    vortexId = 13122,
    vortexAid = 4951,
    time = 10 -- seconds
}

local function removeVortex(position)
    local tile = Tile(position)
    local vortex = tile:getItemById(config.vortexId)
    if not vortex then
        return
    end
    vortex:remove()
    position:sendMagicEffect(CONST_ME_POFF)
end

local creatureevent = CreatureEvent("WildKnowledgeDeath")
function creatureevent.onDeath(creature, corpse, killer, mostDamageKiller, lastHitUnjustified, mostDamageUnjustified)
    if corpse then
        corpse:remove()
    end
    creature:say("The vortex has opened! Enter before it collapses.", TALKTYPE_MONSTER_SAY)
    local vortex = Game.createItem(config.vortexId, 1, creature:getPosition())
    vortex:setActionId(config.vortexAid)
    addEvent(removeVortex, config.time * 1000, creature:getPosition())
    return true
end
creatureevent:register()


thank you very much brother, it worked for me
 
Last edited:
Back
Top