Oskar
Forum friend
- Joined
- Jan 24, 2009
- Messages
- 2,256
- Reaction score
- 331
Tworzymy nowego potwora i wklejamy tam:
Idziemy do folderu creaturescripts i tworzymy nowy plik i wklejamy do niego:
Oraz do creaturescripts.xml:
Polecam postawienie bossa blisko du?ych skupisk bagiennych, stamt?d czerpie sw? si??.
PHP:
<?xml version="1.0" encoding="ISO-8859-1"?>
<monster name="Du Vea" nameDescription="Du Vea" monsterType="bonelord" race="venom" experience="1055" speed="210" manacost="0">
<health now="1700" max="1700"/>
<look type="210" corpse="6037"/>
<targetchange interval="2000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag attackable="1"/>
<flag hostile="1"/>
<flag convinceable="1"/>
<flag canpushitems="1"/>
<flag targetdistance="4"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<script>
<event name="Du_Vea"/>
</script>
<attacks>
<attack name="melee" interval="2000" skill="75" attack="35" poison="-100"/>
<attack name="energy" interval="964" chance="11" target="1" min="-87" max="-143">
<attribute key="shootEffect" value="energy"/>
<attribute key="areaEffect" value="purpleenergy"/>
</attack>
<attack name="death" interval="986" chance="12" target="1" min="-142" max="-184">
<attribute key="shootEffect" value="suddendeath"/>
<attribute key="areaEffect" value="mortarea"/>
</attack>
<attack name="earth" interval="975" chance="11" target="1" min="-105" max="-132">
<attribute key="shootEffect" value="earth"/>
<attribute key="areaEffect" value="carniphila"/>
</attack>
<attack name="speed" interval="1003" chance="13" range="7" target="1" speedchange="-321" duration="10000">
<attribute key="areaEffect" value="bats"/>
</attack>
<attack name="poison" interval="1064" chance="12" length="6" spread="2" min="-179" max="-241">
<attribute key="areaEffect" value="greenbubble"/>
</attack>
<attack name="lifedrain" interval="1105" chance="13" length="4" spread="2" min="-142" max="-197">
<attribute key="areaEffect" value="yellowbubble"/>
</attack>
<attack name="manadrain" interval="997" chance="13" target="1" min="-75" max="-99">
<attribute key="areaEffect" value="teleport"/>
</attack>
</attacks>
<defenses armor="15" defense="20">
<defense name="healing" interval="897" chance="11" min="85" max="128">
<attribute key="areaEffect" value="blueshimmer"/>
</defense>
</defenses>
<elements>
<element holyPercent="-5"/>
<element firePercent="-10"/>
<element energyPercent="50"/>
<element deathPercent="25"/>
</elements>
<immunities>
<immunity paralyze="1"/>
<immunity earth="1"/>
<immunity invisible="1"/>
<immunity lifedrain="1"/>
</immunities>
<voices interval="5000" chance="10">
<voice sentence="653768764!"/>
<voice sentence="Inferior creatures, bow before my power!"/>
</voices>
<loot>
<item id="2397" chance="13540"/> --longsword
<item id="2175" chance="11560"/> --spellbook
<item id="7884" chance="4320"/> --terra mantle
<item id="2181" chance="9300"/> --terra rod
<item id="5898" chance="100000"/> --beho eye
<item id="2509" chance="9890"/> --steel shield
<item id="3972" chance="2310"/> --beho helmet
<item id="2377" chance="6540"/> --two handed sword
<item id="2518" chance="1040"/> --beho shield
<item id="2394" chance="6540"/> --morning star
<item id="2512" chance="21050"/> --wooden shield
<item id="7590" countmax="2" chance="7540"/> --GMP
<item id="2149" countmax="4" chance="4320"/> --small emerald
<item id="2148" countmax="56" chance="33960"/> --gold
<item id="2148" countmax="86" chance="33960"/> --gold
</loot>
</monster>
Idziemy do folderu creaturescripts i tworzymy nowy plik i wklejamy do niego:
PHP:
local normalSwamp = {4691,4692,4693,4694,4695,4696,4697,4698,4699,4700,4701,4702,4703,4704,4705,4706,4707,4708,4709,4710,4711,4712,4749,4750,4751,4752,4753,4754,4755}
local swampWalkable = 6353
local function doTryKillCreature(cid, position)
doSendMagicEffect(position, CONST_ME_SMALLPLANTS)
local creatureFound = getTopCreature(position).uid
if isCreature(creatureFound) and creatureFound ~= cid then
local targetHealth = getCreatureHealth(creatureFound)
return doTargetCombatHealth(cid, creatureFound, COMBAT_EARTHDAMAGE, -(targetHealth / 5), -(targetHealth / 3), CONST_ME_CARNIPHILA)
end
return false
end
local function doSendEffect(cid, position, n)
if isCreature(cid) then
doSendMagicEffect(position, CONST_ME_HITBYPOISON)
doSendMagicEffect(position, CONST_ME_GREEN_RINGS)
return n < 6 and addEvent(doSendEffect, 250, cid, position, n + 1) or addEvent(doTryKillCreature, 1000, cid, position)
end
return false
end
function onThink(cid)
if isMonster(cid) and math.random(100) <= 21 then
local position, tableWithPositions = getThingPos(cid), {}
for nx = position.x - 5, position.x + 5 do
for ny = position.y - 5, position.y + 5 do
local newPosition = {x=nx, y=ny, z=position.z}
local itemFound = getTileThingByPos(newPosition)
if itemFound.uid > 0 and isInArray(normalSwamp, itemFound.itemid) then
table.insert(tableWithPositions, newPosition.x)
table.insert(tableWithPositions, newPosition.y)
table.insert(tableWithPositions, newPosition.z)
end
end
end
if #tableWithPositions ~= 0 then
local tableRandomValue = math.random(#tableWithPositions/3)
local normalSwampPosition = {x=tableWithPositions[tableRandomValue*3-2], y=tableWithPositions[tableRandomValue*3-1], z=tableWithPositions[tableRandomValue*3]}
local swampUid = getTileThingByPos(normalSwampPosition)
if swampUid.uid > 0 and isInArray(normalSwamp, swampUid.itemid) then
local oldSwampId = swampUid.itemid
if math.random(10) <= 7 then
local target = getCreatureTarget(cid)
local pos = isCreature(target) and getThingPos(target)
if isCreature(target) and getDistanceBetween(position, pos) <= 5 and isSightClear(position, pos, true) and isSightClear(normalSwampPosition, pos, true) then
doTransformItem(swampUid.uid, swampWalkable)
if not isWalkable(normalSwampPosition, true, true, true) then
return doTransformItem(swampUid.uid, oldSwampId)
end
local creatureMonster = doCreateMonster('acid blob', normalSwampPosition, false)
addEvent(function() return isCreature(creatureMonster) and doSendMagicEffect(normalSwampPosition, CONST_ME_GREEN_RINGS) and doRemoveThing(creatureMonster) end, 1000, normalSwampPosition, creatureMonster)
doSendMagicEffect(normalSwampPosition, CONST_ME_GREEN_RINGS)
doTransformItem(swampUid.uid, oldSwampId)
doSendDistanceShoot(normalSwampPosition, pos, CONST_ANI_EARTH)
doSendMagicEffect(pos, CONST_ME_HITBYPOISON)
doSendMagicEffect(pos, CONST_ME_GREEN_RINGS)
return addEvent(doSendEffect, 250, cid, pos, math.random(-2,2))
end
else
if isSightClear(normalSwampPosition, position, true) then
doTransformItem(swampUid.uid, swampWalkable)
if not isWalkable(normalSwampPosition, true, true, true) then
return doTransformItem(swampUid.uid, oldSwampId)
end
local creatureMonster = doCreateMonster('acid blob', normalSwampPosition, false)
addEvent(function() return isCreature(creatureMonster) and doSendMagicEffect(normalSwampPosition, CONST_ME_GREEN_RINGS) and doRemoveThing(creatureMonster) end, 1000, normalSwampPosition, creatureMonster)
doSendMagicEffect(normalSwampPosition, CONST_ME_GREEN_RINGS)
doTransformItem(swampUid.uid, oldSwampId)
local monsterHealth = math.random(getCreatureMaxHealth(cid)*0.25,getCreatureMaxHealth(cid)*0.4)
doSendDistanceShoot(normalSwampPosition, position, CONST_ANI_EARTH)
doSendMagicEffect(position, CONST_ME_SMALLPLANTS)
return doCreatureAddHealth(cid, monsterHealth)
end
end
end
end
end
return true
end
PHP:
<event type="think" name="Du_Vea" event="script" value="nazwaPliku.lua"/>
Polecam postawienie bossa blisko du?ych skupisk bagiennych, stamt?d czerpie sw? si??.