Hello.
~~MONSTERS~~
First we go to data/monsters and make file Criredric.xml and paste:
Now make file Weak Vampire.xml and paste:
Into monsters.xml paste:
~~CREATURESCRIPTS~~
Now we go to data/creaturescripts/scripts and make file criredric.lua and paste:
Into login.lua before return true paste:
Into creaturescripts.xml paste:
Have fun.
~~MONSTERS~~
First we go to data/monsters and make file Criredric.xml and paste:
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Criredric" nameDescription="Criredric" race="undead" experience="1275" speed="245" manacost="0">
<health now="2150" max="2150"/>
<look type="68" corpse="6006"/>
<targetchange interval="1250" chance="12"/>
<strategy attack="100" defense="0"/>
<flags>
<flag attackable="1"/>
<flag hostile="1"/>
<flag convinceable="1"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="15"/>
</flags>
<script>
<event name="Criredric"/>
</script>
<attacks>
<attack name="melee" interval="2000" skill="75" attack="60"/>
<attack name="lifedrain" interval="1064" chance="12" range="1" min="-132" max="-199">
<attribute key="areaEffect" value="redshimmer"/>
</attack>
<attack name="death" interval="987" chance="5" target="1" range="3" min="-234" max="-261">
<attribute key="areaEffect" value="mortarea"/>
<attribute key="shootEffect" value="suddendeath"/>
</attack>
<attack name="death" interval="987" chance="14" target="1" range="3" min="-74" max="-91">
<attribute key="areaEffect" value="mortarea"/>
<attribute key="shootEffect" value="death"/>
</attack>
<attack name="speed" interval="1111" chance="12" target="0" radius="4" speedchange="-389" duration="10000">
<attribute key="areaEffect" value="redshimmer"/>
</attack>
</attacks>
<defenses armor="17" defense="23">
<defense name="outfit" interval="1063" chance="16" monster="bat" duration="2500">
<attribute key="areaEffect" value="poff"/>
</defense>
<defense name="outfit" interval="1102" chance="16" monster="vampire" duration="6000">
<attribute key="areaEffect" value="poff"/>
</defense>
<defense name="speed" interval="976" chance="10" speedchange="186" duration="6000">
<attribute key="areaEffect" value="redshimmer"/>
</defense>
</defenses>
<elements>
<element physicalPercent="30"/>
<element firePercent="-5"/>
<element holyPercent="-15"/>
</elements>
<immunities>
<immunity earth="1"/>
<immunity death="1"/>
<immunity drown="1"/>
<immunity drunk="1"/>
<immunity lifedrain="1"/>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<voices interval="5000" chance="100">
<voice sentence="BLOOD!" yell="1"/>
<voice sentence="Let me kiss your neck."/>
<voice sentence="I smell warm blood."/>
<voice sentence="I call you, my bats! Come!"/>
</voices>
<summons maxSummons="3">
<summon name="Bat" interval="987" chance="18"/>
</summons>
<loot>
<item id="2148" countmax="19" chance="11550"/> --gold
<item id="7403" chance="1310"/> --berserker
<item id="10601" chance="6760"/> --vamp teeth
<item id="5905" chance="100000"/> --vamp dust
<item id="2172" chance="970"/> --bronze amulet
<item id="982" countmax="3" chance="1000"/> --dark talon
<item id="2148" countmax="9" chance="11550"/> --gold
<item id="6300" chance="7580"/> --death ring
<item id="2229" countmax="3" chance="22980"/> --skull
<item id="2238" chance="16970"/> --worn leather boots
<item id="2747" chance="14700"/> --grave flower
<item id="2534" chance="1340"/> --vamp shield
<item id="2483" chance="14390"/> --scale armor
<item id="8903" chance="1390"/> --sb of lost soul
<item id="7588" countmax="3" chance="13480"/> --SHP
<item id="2479" chance="12440"/> --strange helmet
</loot>
</monster>
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="weak vampire" nameDescription="a weak vampire" race="undead" experience="95" speed="220" manacost="0">
<health now="260" max="260"/>
<look type="68" corpse="6006"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag attackable="1"/>
<flag hostile="1"/>
<flag convinceable="1"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="55" attack="30"/>
<attack name="lifedrain" interval="1075" chance="11" range="1" min="-20" max="-100">
<attribute key="areaEffect" value="redshimmer"/>
</attack>
<attack name="speed" interval="975" chance="8" target="1" speedchange="-298" duration="12000">
<attribute key="areaEffect" value="redshimmer"/>
</attack>
</attacks>
<defenses armor="15" defense="20">
<defense name="outfit" interval="1042" chance="17" monster="bat" duration="2000">
<attribute key="areaEffect" value="poff"/>
</defense>
<defense name="healing" interval="994" chance="13" min="14" max="38"/>
<defense name="speed" interval="1053" chance="11" speedchange="206" duration="6000">
<attribute key="areaEffect" value="redshimmer"/>
</defense>
</defenses>
<elements>
<element physicalPercent="10"/>
<element firePercent="-15"/>
<element holyPercent="-25"/>
</elements>
<immunities>
<immunity earth="1"/>
<immunity death="1"/>
<immunity drown="1"/>
<immunity drunk="1"/>
<immunity lifedrain="1"/>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<voices interval="5000" chance="100">
<voice sentence="BLOOD!" yell="1"/>
<voice sentence="I smell warm blood."/>
</voices>
<loot>
<item id="2148" countmax="10" chance="5090"/> --gold
<item id="10601" chance="2760"/> --vampire teeth
<item id="2144" chance="480"/> --black pearl
<item id="2229" chance="350"/> --skull
<item id="2172" chance="50"/> --bronze amulet
</loot>
</monster>
PHP:
<monster name="Criredric" file="Criredric.xml"/>
<monster name="Weak Vampire" file="weak vampire.xml"/>
~~CREATURESCRIPTS~~
Now we go to data/creaturescripts/scripts and make file criredric.lua and paste:
PHP:
local monsters = {
[2956] = {monster = "weak vampire"},
[4298] = {monster = "bat"}
}
local tiles = {2957,2958,4299,4300}
local fields = {
[1] = {item_id = {1497,1499}, effect = CONST_ME_TELEPORT},
[2] = {item_id = {1492,1493,1494}, effect = CONST_ME_MAGIC_RED},
[3] = {item_id = {1495}, effect = CONST_ME_MAGIC_BLUE},
[4] = {item_id = {1496}, effect = CONST_ME_MAGIC_GREEN},
[5] = {item_id = {967}, effect = CONST_ME_MAGIC_RED},
[6] = {item_id = {11779}, effect = CONST_ME_ASSASSIN}
}
local function effect(p)
local fieldFound = getThingFromPos(p.pos)
if isCreature(p.cid) then
doSendMagicEffect(p.pos, CONST_ME_MORTAREA)
if p.n < 4 then
p.n=p.n+1
addEvent(effect, 250, p)
else
if monsters[fieldFound.itemid] then
doCreateMonster(monsters[fieldFound.itemid].monster, p.pos, false)
doRemoveItem(fieldFound.uid)
elseif isInArray(tiles, fieldFound.itemid) then
doCreateItem(fieldFound.itemid-1, 1, p.pos)
doRemoveItem(fieldFound.uid)
end
end
end
end
function onThink(cid)
if isMonster(cid) then
local pos = getCreaturePosition(cid)
if math.random(1, 100) <= 7 then
if getCreatureHealth(cid) < getCreatureMaxHealth(cid) then
for nx = (pos.x - 3), (pos.x + 3) do
for ny = (pos.y - 3), (pos.y + 3) do
local creatureFound = getThingFromPos({x=nx,y=ny,z=pos.z,stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE})
if creatureFound.uid ~= cid and isMonster(creatureFound.uid) and getCreatureName(creatureFound.uid) == "bat" and getCreatureMaster(creatureFound.uid) == cid and isSightClear(getCreaturePosition(creatureFound.uid), pos, true) then
local hp = math.ceil(getCreatureHealth(creatureFound.uid)+math.random(1,9))
doCreatureAddHealth(cid, hp)
doSendAnimatedText(pos, hp, COLOR_BLACK)
doSendDistanceShoot(getThingPos(creatureFound.uid), pos, CONST_ANI_DEATH)
doSendMagicEffect(pos, CONST_ME_MORTAREA)
end
end
end
end
end
if math.random(1, 100) <= 15 then
for nx = (pos.x - 2), (pos.x + 2) do
for ny = (pos.y - 2), (pos.y + 2) do
for i = 1, 254 do
stackpos = i
local fieldFound = getThingFromPos({x = nx, y = ny, z = pos.z, stackpos = stackpos})
if fieldFound.uid ~= 0 and isInArray({2956,2957,2958,4298,4299,4300}, fieldFound.itemid) and isSightClear(pos, getThingPos(fieldFound.uid), true) then
local poss = getThingPos(fieldFound.uid)
addEvent(effect, 250, {pos=poss, cid=cid, n=1, fieldFound=fieldFound})
end
end
end
end
end
if math.random(1, 100) <= 10 then
for nx = (pos.x - 1), (pos.x + 1) do
for ny = (pos.y - 1), (pos.y + 1) do
for i = 1, 254 do
stackpos = i
local fieldFound = getThingFromPos({x = nx, y = ny, z = pos.z, stackpos = stackpos})
for k = 1, #fields do
if fieldFound.uid ~= 0 and isInArray(fields[k].item_id, fieldFound.itemid) then
doSendMagicEffect(getThingPos(fieldFound.uid), fields[k].effect)
doRemoveItem(fieldFound.uid)
end
end
end
end
end
end
end
return true
end
PHP:
registerCreatureEvent(cid, "Criredric")
PHP:
<event type="think" name="Criredric" event="script" value="Criredric.lua"/>