Open ArturKnopik opened 2 weeks ago
for /s
fix looks easy to be done
changes required in file place_npc.lua
function onSay(player, words, param)
if not player:getGroup():getAccess() then
return true
end
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
local position = player:getPosition()
local npc = NpcType(param) -- <<< change to Game.createNpc(param, position)
if npc then
Game.createNpc(param, position) -- <<< to remove
position:sendMagicEffect(CONST_ME_MAGIC_RED)
else
player:sendCancelMessage("There is not enough room.")
position:sendMagicEffect(CONST_ME_POFF)
end
return false
end
I don't really get the sense behind this, as you can spawn the same npc just fine with /s
or adding them several times in the mapeditor why would you want to make another xml file for the same npc?
I'll include the changes proposed to /s
in revnpcsys version 1.4
Example from issue is to fast setup env when issue occure
example: i want to have 2 npc with displayed name Traveler Traveler1.xml (travel1.lua) that teleport player to Island Traveler2.xml (travel2.lua) that teleport player to main land What was possible before changes is both npc has the same display name. For now file name is used and described behavior is impossible On map i will have Traveler1 and Traveler2 instead 2x Traveler (with different behaviors)
About /s - npc must not be loaded during startup(not present in spawn.xml)
By submitting this bug issue, you agree to the following.
Does this bug crash tfs?
no
Server Version
1.7 (Master)
Operation System
all (listed below)
OS Description
No response
Bug description
Can't create multiple different NPC with the same display name
Possible Pull Requests which are to blame
Steps to reproduce
Riona.xml
->Riona_Two.xml
/s
not working if NPC isn't on the map)/goto Riona_Two
Additiona:
/s Riona_Two
not workinActual Behavior
/goto Riona_Two
works, NPC have invalid name(name is taken from filename)/s Riona_Two
not workingExpected Behavior
/goto Riona_Two
should not works, npc Riona_Two.xml NPC should have Riona name(taken from xml file fromname
field)/s Riona_Two
should create npc from Riona_Two.xml file named RionaBacktrace
No response