LuisPro
World War <3
- Joined
- May 10, 2009
- Messages
- 425
- Solutions
- 1
- Reaction score
- 53
yes, its only affect mobs.Well yea, but I cannot reproduce this with all walls..
also it does only affect mobs, me as player cant shoot pass walls, also not mwalls
yes, its only affect mobs.Well yea, but I cannot reproduce this with all walls..
also it does only affect mobs, me as player cant shoot pass walls, also not mwalls
Do you have an idea where in the source it is handled, then i could fix it
I will else search it some time later
Look at this: https://github.com/TwistedScorpio/OTHire/blob/master/source/spells.cpp#L766-L814
And based on that you can create one for monsters too.
The part that you want: https://github.com/TwistedScorpio/OTHire/blob/master/source/spells.cpp#L805-L809
You should add the condition here:
https://github.com/TwistedScorpio/OTHire/blob/master/source/spells.cpp#L399-L426
Well yea, but I cannot reproduce this with all walls..
also it does only affect mobs, me as player cant shoot pass walls, also not mwalls
Tile* targetTile = g_game.getTile(targetPos.x, targetPos.y, targetPos.z);
if (targetTile->hasProperty(BLOCKSOLID)) {
return false;
}
bool Monster::canUseSpell(const Position& pos, const Position& targetPos,
const spellBlock_t& sb, uint32_t interval, bool& inRange)
@Thaian CitizenWell yea, but I cannot reproduce this with all walls..
Ezzz, im preety sure he just test it wrong.If it is only happening within certain walls, I would check those walls attributes and compare them to the walls that it is not working.
data/npc/scripts/bank.lua:36: attempt to call global 'getNumber' <a nil value> stack traceback
data/npc/scripts/bank.lua:36: in function 'callback'
data/npc/scripts/lib/npcsystem/npchandler.lua:299: in function 'onCreatureSay'
data/npc/scripts/bank.lua:10: in function <data/npc/scripts/bank.lua:10:>
-- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback.
function NpcHandler:onCreatureSay(cid, msgtype, msg)
local callback = self:getCallback(CALLBACK_CREATURE_SAY)
if(callback == nil or callback(cid, msgtype, msg)) then
if(self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, msgtype, msg)) then
if(not self:isInRange(cid)) then
return
end
if(self.keywordHandler ~= nil) then
local ret = self.keywordHandler:processMessage(cid, msg)
if(not ret) then
local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT)
if(callback ~= nil and callback(cid, msgtype, msg)) then
self.talkStart = os.time()
end
else
self.talkStart = os.time()
end
end
end
end
end
-- OTServ event handling functions start
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
----------------------CHANGE GOLD---------------------------------------------------------------------------------
elseif talkState == 8 and getNumber(msg) == 0 or getNumber(msg) >= 999 then
npcHandler:say('How many platinum coins do you want to get?')
elseif talkState == 8 then
n = getNumber(msg)
b = n * 100
npcHandler:say('So I should change '..b..' of your gold coins to '..n..' platinum coins for you?')
talkState = 9
elseif talkState == 9 then
if msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid, 2148, b) == TRUE then
doPlayerAddItem(cid, 2152, n)
npcHandler:say('Here you are.')
talkState = 0
else
npcHandler:say('You do not have enough money.')
talkState = 0
end
else
npcHandler:say('Ok. We cancel.')
talkState = 0
end
That did not happen on level ups in that version... That is some fancy new stuffWhat I find interesting is that after reading 70 pages of all sorts of fixes I have not even once read about the fact that upon leveling, a players mana doesn't seem to return to full. I'm quite sure that upon advancing a level both values, health and mana should return to full.
Now sure if any of you encountered the same bug, or just hadn't noticed but I'd gladly appreciate any answers helping me in this matter.
Thanks for the swift reply. That resolves the first issue, thank you Thaian Citizen.That did not happen on level ups in that version... That is some fancy new stuff
That's when a github repo comes to help you...Remember to backup, on more than one HDD.
I spent alot of work with the sources of OThire, quests, actions of this OT trying to make a good OT, fixed shared experience, added loot messages, corpse ownership, guild war, even made a sick ass NPC gambler from scratch which I fully perfected...I spent alooot of time.
But then things happened in real life and I had to take a break, I saved my work on my second HDD, my main HDD died but I still had it on my second HDD, but somehow it disappeared, but I didn't delete it. Weird. I tried every recovery software out there but its long gone, I use alot of stuff on my second HDD so it's was long overwritten. If you have lost some files on a HDD, don't use the HDD anymore! The more you write over files the harder it will be to recover.
Just a reminder for you guys. Save your work! If you have some extra USB-sticks, save your work on them too.
Put this code inside of functions.luaWhat I find interesting is that after reading 70 pages of all sorts of fixes I have not even once read about the fact that upon leveling, a players mana doesn't seem to return to full. I'm quite sure that upon advancing a level both values, health and mana should return to full.
Now sure if any of you encountered the same bug, or just hadn't noticed but I'd gladly appreciate any answers helping me in this matter.
Besides that I've been having a lot of trouble with my banking NPC. For some odd reason it doesn't recognize the getNumber value, which indicated that this is missing somewhere in the NPChandler.lua file.
Config message:
Code:data/npc/scripts/bank.lua:36: attempt to call global 'getNumber' <a nil value> stack traceback data/npc/scripts/bank.lua:36: in function 'callback' data/npc/scripts/lib/npcsystem/npchandler.lua:299: in function 'onCreatureSay' data/npc/scripts/bank.lua:10: in function <data/npc/scripts/bank.lua:10:>
NPCHandler lines 287 - 308:
Code:-- Handles onCreatureSay events. If you with to handle this yourself, please use the CALLBACK_CREATURE_SAY callback. function NpcHandler:onCreatureSay(cid, msgtype, msg) local callback = self:getCallback(CALLBACK_CREATURE_SAY) if(callback == nil or callback(cid, msgtype, msg)) then if(self:processModuleCallback(CALLBACK_CREATURE_SAY, cid, msgtype, msg)) then if(not self:isInRange(cid)) then return end if(self.keywordHandler ~= nil) then local ret = self.keywordHandler:processMessage(cid, msg) if(not ret) then local callback = self:getCallback(CALLBACK_MESSAGE_DEFAULT) if(callback ~= nil and callback(cid, msgtype, msg)) then self.talkStart = os.time() end else self.talkStart = os.time() end end end end end
Bank.LUA lines 7-11
Code:-- OTServ event handling functions start function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end
Bank.LUA lines 35-57
Code:----------------------CHANGE GOLD--------------------------------------------------------------------------------- elseif talkState == 8 and getNumber(msg) == 0 or getNumber(msg) >= 999 then npcHandler:say('How many platinum coins do you want to get?') elseif talkState == 8 then n = getNumber(msg) b = n * 100 npcHandler:say('So I should change '..b..' of your gold coins to '..n..' platinum coins for you?') talkState = 9 elseif talkState == 9 then if msgcontains(msg, 'yes') then if doPlayerRemoveItem(cid, 2148, b) == TRUE then doPlayerAddItem(cid, 2152, n) npcHandler:say('Here you are.') talkState = 0 else npcHandler:say('You do not have enough money.') talkState = 0 end else npcHandler:say('Ok. We cancel.') talkState = 0 end
I've ben stuck with this bit of code for the longest of times now, and I can't seem to resolve it on my own.
Better yet, I need help.
Hopefully some of you are able to provide me with a satisfactory answer.
Yours,
Kjeld
function getNumber(msg)
b, e = string.find(msg, "%d+")
if b == nil or e == nil then
count = 1
else
count = tonumber(string.sub(msg, b, e))
end
return count
end
Put this code inside of functions.lua
Code:function getNumber(msg) b, e = string.find(msg, "%d+") if b == nil or e == nil then count = 1 else count = tonumber(string.sub(msg, b, e)) end return count end