J.Dre
Unity Games
Party Dueling
For quests, tasks, or whatever.
Information
This script was made for and tested on TFS 0.3.7, it will not work for TFS 0.2 in its current form. I made this script for someone who requested it for "Pokemon" stuff, if I remember correctly. I thought since the thread was closed and renamed, no one would ever find it via searching, or it would be more difficult than it already is. Therefor, I decided to make a thread to share this with others who may be interested in such a script for whatever purpose. Anyway, I'm sure it will be of use to someone. Even if there's only one person I helped by posting this, I'm still happy to have done so - enjoy!
Note: The current form of this script is very simple and basic. I did not add many additional features because I want people to learn how to do so themselves. You can incorporate tasks, missions, or even check areas of the map where this script can be enabled. If you need help, please post here or send me a private message - I'll do my best to assist you, or refer you to someone who can.
What does this script do?
It restricts dueling to those in the same party, specifically with summons.
Need further support?
Please do not be afraid to post here if you need assistance. I may not respond immediately, but I will respond.
Feedback is appreciated!
creaturescripts.xml
login.lua
duel.lua
For quests, tasks, or whatever.
Information
This script was made for and tested on TFS 0.3.7, it will not work for TFS 0.2 in its current form. I made this script for someone who requested it for "Pokemon" stuff, if I remember correctly. I thought since the thread was closed and renamed, no one would ever find it via searching, or it would be more difficult than it already is. Therefor, I decided to make a thread to share this with others who may be interested in such a script for whatever purpose. Anyway, I'm sure it will be of use to someone. Even if there's only one person I helped by posting this, I'm still happy to have done so - enjoy!
Note: The current form of this script is very simple and basic. I did not add many additional features because I want people to learn how to do so themselves. You can incorporate tasks, missions, or even check areas of the map where this script can be enabled. If you need help, please post here or send me a private message - I'll do my best to assist you, or refer you to someone who can.
What does this script do?
It restricts dueling to those in the same party, specifically with summons.
Need further support?
Please do not be afraid to post here if you need assistance. I may not respond immediately, but I will respond.
Feedback is appreciated!
creaturescripts.xml
XML:
<event type="target" name="Duel" event="script" value="duel.lua" />
login.lua
Lua:
registerCreatureEvent(cid, "Duel")
duel.lua
Lua:
local storage = 12345 -- the storage of a quest or assignment (task)
function onTarget(cid, target)
if(isSummon(target)) then
local master = getCreatureMaster(target)
if(master and master == target) then return true end
if(master and master ~= target) then
if(not isInParty(cid) and not isInParty(master)) then
if(getCreatureStorage(cid, storage) > 0) then
return true
else
doPlayerSendCancel(cid, "You must be in a party to duel.")
return false
end
elseif(getPlayerParty(cid) ~= getPlayerParty(master)) then
if(getCreatureStorage(cid, storage) > 0) then
return true
else
doPlayerSendCancel(cid, "You must be in the same party to duel.")
return false
end
end
end
end
return true
end