whitevo
Feeling good, thats what I do.
Ok this post from yesterday is totally useless xD
I must lock my computer when i'm drunk .....
Anyway. I'm about half way done with the monster AI and spellCreating system.
Nothing yet is completely ready, all my main functions area uncleaned and expecting some features yet to come.
I go trough that spell by spell and whenever creature behavior should change because of spell I will have easier time to implement it if I don't "finalize" my functions.
This is not complete yet, but looks quite alright imo. currently I have been able to config the cyclops spells.
I will now make the spells more awesome looking too visually.
Today I start making Big Daddy spells.
I must lock my computer when i'm drunk .....
Anyway. I'm about half way done with the monster AI and spellCreating system.
Nothing yet is completely ready, all my main functions area uncleaned and expecting some features yet to come.
I go trough that spell by spell and whenever creature behavior should change because of spell I will have easier time to implement it if I don't "finalize" my functions.
This is not complete yet, but looks quite alright imo. currently I have been able to config the cyclops spells.
I will now make the spells more awesome looking too visually.
Today I start making Big Daddy spells.
Code:
--[[ spellCreating config guide
firstCastCD = INT or 1000 how many milliseconds has to wait before can cast the first spell
cooldown = INT or 1000 time in milliseconds
locked = BOOL if true then this spell cant be casted until something else unlocks it
changeTarget = BOOL, Caster searches new target after spell activation
targetConfig = { generates targetList with configurations
-- objects
itemID adds itemID to targetList (used in environmental changes)
"caster" adds spell caster to targetList
"enemy" adds players around caster to targetList
"friend" adds monsters around caster to targetList
"target" adds previous target to targetList
"cTarget" adds current caster target to targetList
[objects] = { config to each object. | if not table used then creates it with default values
object can also be objectTable EX: [{INT, INT, "caster"}] = {config}
if value is not table then table is automatically generated with default values
range = INT or 10 if object too far then its not added to targetList
requiredID = INT or INT every object with this ID will be counted towards this ID requirement | default numbere starts with 1 and adds 1 for each unique object
getPath = BOOL if getPath() then target added to targetList
obstacles = {STR} list of getPath obstacles
"noTile" - if Tile(pos)
"noGround" - if not tile:getGround()
"solid" - if tile:hasProperty(CONST_PROP_BLOCKSOLID)
"creature" - if tile:getTopCreaure()
"blockThrow"- if tile:hasProperty(CONST_PROP_BLOCKPROJECTILE)
itemID - if findItem(itemID, pos)
usePosTConfig = BOOL -- instead should simply use position configuration here too
}
requiredT = { how many objects need to be found for each requirement | missing table default = amount of 1 for each required ID
[requiredID] = INT INT amount of objects needs to be found
}
}
position = {
endPosT = { generates all the end positions, when missing then uses startPositons
startPoint = startPosT hardcoded !NB can only use endPoint for endPosT
}
startPosT = { generates all the start positions (same configs apply to both)
range = INT or 10 compares startPoint with endPoint
startPoint = { objects are read in order.
"caster" caster:getPosition()
"enemy" caster:getEnemies() - and takes each position
"friend" monster:getFriendList() - and takes each position
"cTarget" current caster target position
itemID finds this item position near caster
"endPos" previous endPositions
"startPos" previous startPositions
},
endPoint = {} same config as startPoint
singlePosPoint = BOOL if true then first position what passes all parameters is taken (used in getPointPosT)
pointPosFunc = STR _G[STR](posConfT, startPointPosT, endPointPosT) -- rewrites default createPosPointT function
"pointPosFunc_far" - from given positions, finds pos which is furthest away from STARTPOINT (getPath goes as far as 7)
"pointPosFunc_near" - from given positions, finds pos which is closest to STARTPOINT
areaConfig = { compares STARTPOSITIONS and ENDPOSITIONS STARTPOINT
area = areaT single area from areas table
relativeArea = areaT secondary area table for relative directions (if not used then randomly casts either to x axis or y axis)
},
getPath = {
stopOnPath = {STR}, objects are read in order.
"solid" - stops before solid tile
"enemy" - stops before enemy
"friend" - stops before friend
itemID - stops before item
obstacles = {STRING} "solid" - goes around solid objects
"enemy" - goes around enemies
"friend" - goes around friend
itemID - goes around items
}
posTFunc = STR _G[STR](caster, targetList, previousTargetList, previousEndPosT, previousStartPosT)
blockObjects = {STRING/INT} removes some postions from startPosT - clearPositions()
"solid" - CONST_PROP_IMMOVABLEBLOCKSOLID
"caster" - removes position when there is caster
"enemy" - removes position when there exist enemy userdata
"friend" - removes position when there exist friend userdata
itemID - removes position when there exist itemType(itemID)
onlyItemPos = {INT}, ONLY collects positions where are these itemID's
randomPos = INT, Picks randomly INT amount of positions from final result
randomPerLayer = BOOL if true then picks randomPos amount of positions on each layer
}
}
-- variables what work on all features
onTargets = BOOL if true then instead of using created positions it directly does something to targetlist cid(in case of items uses targetList position)
delay = INT ms time before feature is activated
hook = BOOL if true then executes this feature if hook was true | only checked onrecast
-- above variables work on features: damage, changeEnvironment
recastPerPos = BOOL if true then recasts this table for each position (doesnt recast on repeats)
stunOnHook = BOOL if true then only stuns when feature hook is true
stunDuration = INT time in milliseconds (stuns position)
stunL = INT or 0 level of stun
-- features
damage = { hooks activate onHit
interval = INT or 0 milliseconds betweeen area index positions (if not onTargets)
cid = INT or cid cid = caster:getId()
origin = INT or 14 14 = O_monster_spells
minDam = INT minimum damage
maxDam = INT or minDam maximum damage
formulaFunc = STR returns minDam and maxDam _G[STR](caster, pos)
minScale = INT extra damage scalingSystemValue * INT
maxScale = INT
damType = ENUM, combat damage Type
distanceEffect = ENUM animation effect from startPositions to end positions
effect = ENUM, animation effect on the position
effectOnHit = ENUM, animation effect when player gets hit
effectOnMiss = ENUM, animation effect when nobody gets hit, used if not DIRECT DAMAGE
repeatAmount = INT Repeats same damage INT amount of times.
},
changeEnvironment = { hooks activate on item remove
items = {INT}, list of items what are created to positions
randomised = BOOL, if true then only one of the items is created to positions
removeItems = {INT}, List of items what are removed from position if they exist there
removeTime = INT, ms time created item is removed
spawnTime = INT, ms time when removed item spawns back
itemDelay = INT, ms time between creating the items
blockObjects = {STRING/INT} removes some postions from startPosT - clearPositions()
"solid" - CONST_PROP_IMMOVABLEBLOCKSOLID
"caster" - removes position when there is caster
"enemy" - removes position when there exist enemy userdata
"friend" - removes position when there exist friend userdata
itemID - removes position when there exist itemType(itemID)
customFunc = STR _G[STR](cid, itemID, pos, currentItemRemoved, featureT, targetList, endPosT, startPosT, previousTargetList, previousEndPosT, previousStartPosT)
orderChanger = { -- not yet created
S = 1, Takes item index+1 from items table when using South Area
E = -3, Takes item index-3 from items table when using East Area
},
},
say = { if targets not used then ORANGE text comes to pos
msg = {STR} or {[delay] = STR} if not delay used then delay is automatically generated with addMsgDelayToMsgT()
msgType = INT or YELLOW type of msg (if targets used)
}
spellLock = {
lockSpells = {STR} list of spells what cant be used anymore (spell still needs to be registered to monster)
unlockSpells = {STR} list of spells what can be used (spell still needs to be registered to monster)
},
spellLockCD = {
[INT] = {STR} INT = cooldown what is added
STR = spellName
},
event = {
duration = INT sec time before registered event is removed
registerEvents = {STR}
unregisterEvents = {STR}
}
teleport = {
effectOnCast = {INT}, Effect before teleporting
effectOnPos = {INT}, Effect after teleport
effectInterval = INT, ms time between the effects on position
walkSpeed = INT, temporar monster speed for teleporting
}
magicEffect = {
effect = {INT}, effect type what will appear in position
effectInterval = INT, ms time between the effects on position
}
flyingEffect = {
effect = INT, Animation effect
}
]]