Code: Select all
cloneObject{
name ="returning_throwing_axe",
baseObject="throwing_axe",
uiName = "Throwing Axe of Returning",
sharpProjectile = false,
stackable = false,
}
cloneObject{
name ="fake_returning_throwing_axe",
baseObject="throwing_axe",
uiName = "Fake Throwing Axe",
sharpProjectile = false,
stackable = false,
attackPower = 0,
throwingWeapon = false,
}
Code: Select all
local monstersList = {"crab","crowern","cube","goromorg","green_slime","herder","herder_big","herder_small","herder_swarm","ice_lizard","ogre","scavenger","scavenger_swarm","shrakk_torr","skeleton_archer","skeleton_archer_patrol","skeleton_patrol","skeleton_warrior","snail","spider","tentacles","uggardian","warden","wyvern"
}
for i=1,# monstersList do
cloneObject{
name = monstersList[i],
baseObject = monstersList[i],
onProjectileHit = function(monster, weapon)
return grims_returning_axe_script.projectileCheck(monster,weapon)
end,
}
end
Code: Select all
cloneObject{
name = "party",
baseObject = "party",
onAttack = function(champion,weapon)
return grims_returning_axe_script.weaponCheck(champion,weapon)
end,
onProjectileHit = function(champion,weapon)
return grims_returning_axe_script.partyProjectileCheck(champion,weapon)
end,
onPickUpItem = function(party,item)
return grims_returning_axe_script.partyPickupCheck(party,item)
end,
}
Code: Select all
-- store the ordinal value of the champion using returning Axe --
thrower_ord = 1 -- set starting thrower Ordinal value purely for the case that you first throw the axe from the mousepointer!
-- find the champion ID from the ordinal number --
function findChampionByOrdinal(ord)
for ch = 1,4 do
if party:getChampion(ch):getOrdinal() == ord then
return party:getChampion(ch)
end
end
end
function getDistance(obj1,obj2)
local distance = 0
local XNumber = math.max(obj1.x,obj2.x) - math.min(obj1.x,obj2.x)
local YNumber = math.max(obj1.y,obj2.y) - math.min(obj1.y,obj2.y)
distance = XNumber + YNumber
return distance
end
-- check if party attack with returning Axe --
function weaponCheck(champion,weapon)
if weapon ~= nil then
if weapon.name == "returning_throwing_axe" then
thrower_ord = champion:getOrdinal()
else
-- hudPrint("Other Weapon")
end
else
-- hudPrint("Unarmed")
end
end
-- Check if Monster Hit by returning Axe --
function projectileCheck(monster,weapon)
if weapon.name == "returning_throwing_axe" then
if findEntity(weapon.id) ~= nil then
weapon:destroy()
local distance = getDistance(party,monster)
local facing = (party.facing + 2)%4
local dx,dy = getForward(facing)
shootProjectile("fake_returning_throwing_axe", party.level, monster.x+dx, monster.y+dy, facing, 2*distance, 1, 1, 0, 0, 0, 0, false, false)
end
end
end
-- Check if Party hit by fake axe --
function partyProjectileCheck(champion,weapon)
local throw_champ = findChampionByOrdinal(thrower_ord)
if weapon.name == "fake_returning_throwing_axe" then
weapon:destroy()
if throw_champ:getItem(7) == nil then
throw_champ:insertItem(7,spawn("returning_throwing_axe"))
elseif throw_champ:getItem(8) == nil then
throw_champ:insertItem(8,spawn("returning_throwing_axe"))
else
spawn("returning_throwing_axe",party.level,party.x,party.y,party.facing)
end
end
end
-- Check if party picks up fake axe --
function partyPickupCheck(party,item)
if item.name == "fake_returning_throwing_axe" then
-- hudPrint("fake axe")
item:destroy()
-- setMouseItem(spawn("returning_throwing_axe"))
-- spawn("returning_throwing_axe",party.level,party.x,party.y,party.facing)
local throw_champ = findChampionByOrdinal(thrower_ord)
if throw_champ:getItem(7) == nil then
throw_champ:insertItem(7,spawn("returning_throwing_axe"))
elseif throw_champ:getItem(8) == nil then
throw_champ:insertItem(8,spawn("returning_throwing_axe"))
else
spawn("returning_throwing_axe",party.level,party.x,party.y,party.facing)
end
return false
end
return true
end
I must have forgot to add them. Both DDS added (spec and dif). I hope everything's fine now.Batty wrote:That ranger shield is the best yet! I can only find the model though, I can't find the .dds.
The new gobelins are great too, I'm gonna find a place for all of them.
Thanks, I'm glad you like it.Huder wrote:Wow these are very good, high quality and professional textures.
Not at all, in fact I've already posted link in C.A.P. thread before checking this threadNeikun wrote:Hey, Mere. Would you mind if we posted links to all the custom content you post on the Nexus to the CAP?
Thanks for pointing this out. It seems like I failed post editing againCiccipicci wrote:For the Ranger's shield code there's a couple of thing to correct.
-The definitions in material.lua should add into the object.lua
-The right code to add into the material.lua is: